Skip to content

Commit 3c3135d

Browse files
Volodymyr-KuchinskyiVladimir Kuchinskiy
andauthored
Fixed error on schema parsing to be more user friendly (#11)
Co-authored-by: Vladimir Kuchinskiy <volodymyr.k@upland.me>
1 parent 47727cb commit 3c3135d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/schema.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,17 @@ export function parseSchemaFromBytesWithRemainder(
6464

6565
const clTypeWithRemainder = matchBytesToCLType(remainder);
6666

67+
const clType = clTypeWithRemainder.result.unwrap();
68+
6769
if (!clTypeWithRemainder.remainder) {
6870
throw new Error('remainder is empty');
6971
}
7072

71-
const clType = clTypeWithRemainder.result.unwrap();
72-
7373
schema.push({
7474
property: fieldName,
7575
value: clType,
7676
});
77+
7778
remainder = clTypeWithRemainder.remainder;
7879
}
7980

0 commit comments

Comments
 (0)