Skip to content

Commit e285273

Browse files
committed
Add custom and dedicated error for splitted items
1 parent bba3144 commit e285273

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/cbor/lib/tinycbor/cbor-lib.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
CborError error = CborNoError; \
2828
error = (expr); \
2929
if (CborErrorOutOfMemory == error) \
30-
return CborErrorTooManyItems; \
30+
return CborErrorSplitItems; \
3131
if (CborNoError != error) \
3232
return error; \
3333
} while(0);

src/cbor/lib/tinycbor/src/cbor.h

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ typedef enum CborError {
189189
/* encoder errors */
190190
CborErrorTooManyItems = 768,
191191
CborErrorTooFewItems,
192+
CborErrorSplitItems,
192193

193194
/* internal implementation errors */
194195
CborErrorDataTooLarge = 1024,

src/cbor/lib/tinycbor/src/cborerrorstrings.c

+3
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ const char *cbor_error_string(CborError error)
163163
case CborErrorTooFewItems:
164164
return _("too few items added to encoder");
165165

166+
case CborErrorSplitItems:
167+
return _("splitted item added to encoder");
168+
166169
case CborErrorDataTooLarge:
167170
return _("internal error: data too large");
168171

0 commit comments

Comments
 (0)