shapito: extend error with detail and hint

This commit is contained in:
Dmitry Simonenko 2017-06-28 15:11:41 +03:00
parent b7285d13ed
commit ce6b3f5c64
2 changed files with 16 additions and 0 deletions

View File

@ -156,6 +156,20 @@ int so_feread_error(so_feerror_t *error, uint8_t *data, uint32_t size)
if (so_unlikely(rc == -1))
return -1;
break;
/* detail */
case 'D':
error->detail = pos;
rc = so_stream_readsz(&pos, &pos_size);
if (so_unlikely(rc == -1))
return -1;
break;
/* hint */
case 'H':
error->hint = pos;
rc = so_stream_readsz(&pos, &pos_size);
if (so_unlikely(rc == -1))
return -1;
break;
/* end */
case 0:
return 0;

View File

@ -13,6 +13,8 @@ struct so_feerror_t {
uint8_t *severity;
uint8_t *code;
uint8_t *message;
uint8_t *detail;
uint8_t *hint;
};
int so_feread_ready(int*, uint8_t*, uint32_t);