From ce6b3f5c64bc50afb9daa5f1b8398798442e8a9a Mon Sep 17 00:00:00 2001 From: Dmitry Simonenko Date: Wed, 28 Jun 2017 15:11:41 +0300 Subject: [PATCH] shapito: extend error with detail and hint --- src/so_feread.c | 14 ++++++++++++++ src/so_feread.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/so_feread.c b/src/so_feread.c index 2defb3d0..0fd1142d 100644 --- a/src/so_feread.c +++ b/src/so_feread.c @@ -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; diff --git a/src/so_feread.h b/src/so_feread.h index fceeb4ea..1f62fc22 100644 --- a/src/so_feread.h +++ b/src/so_feread.h @@ -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);