Errors

A call can fail because a definition is missing, a document is invalid, or the database refuses a change. The examples use the people data to show these results. Use the status and diagnostic fields to identify the failure.

Binding errors

LanguageFailure
CReturns a status. The owner that its operation names holds the diagnostic.
GoReturns *Error.
RustReturns Result<_, Error>.
ClojureThrows clojure.lang.ExceptionInfo with diagnostic data.
PythonRaises StardustError.
OdinReturns an Error beside its result.

The error record gives the fields in your language. Statuses gives the failure conditions of each operation.

error

This record describes a failure with its status and diagnostic. The binding copies the diagnostic before it releases the native owner.

FieldTypeUnitAbsent
codestrNone—
messagestrNone—
pathstr | NoneNoneNone
fieldstr | NoneNoneNone
entityint | NoneNoneNone
offsetint | NoneBytesNone
statusstrNone—

Statuses

Each status names a class of failure. The table lists codes from the binding. Native diagnostic codes can differ.

"invalid_argument"

Codes: time_out_of_range, invalid_argument, out_of_range, non_finite_number, cycle, unsupported_type, too_large, native_failure, live_children, wrong_kind, not_integral, inexact_number, missing_field, unknown_field, duplicate_field, too_deep, length_mismatch, malformed_tag, ambiguous_field, ambiguous_variant, invalid_value, hook_failed.

WhenOperations
the entity ID is outside the user entity range, max_depth is negative or above 32, or max_entities is negativeDatabase.read_entity
the text is malformed, the format is unknown or a number is outside i64 or finite f64parse
the format is unknown or the width is negativeDocument.serialize
the text is malformed, a format is unknown or the width is negativeconvert
the value has a host type with no document form (one the language's standard JSON encoder also refuses), a number outside i64 or finite f64, a decimal or time with no exact native form, a failing conversion method, or a cyclefrom_value
the node breaks the preorder rules or has an invalid kind or numberBuilder.add
a node breaks the preorder rules or has an invalid kind or numberBuilder.add_many
the builder has no root or a container is still openBuilder.seal
id is not a node of the documentDocument.read, Document.children
start is past the last node or capacity is negativeDocument.read_many
id is not an object node of the documentDocument.member, Document.members
the node is not an integer numberDocument.i64
the node is not a number or its value overflows f64Document.f64
the arguments include an undeclared macro parameterbuild_macro, expand_macro
the file is not a database, an option is invalid or selected plugins are incompatibleopen
the parameters or run options are invalidQuery.run, Mutation.run
the parameters or subscription options are invalidQuery.subscribe
max_wait is negativeSubscription.next, Database.indexes_sync
the patch is not an entity-keyed object, or a link names an ID outside the user entity rangeDatabase.merge_patch
the kind, action, revision or page limits are invalid, or the selected plan cannot run the current authored definitionDatabase.plan
the kind or the pattern is invalidDatabase.definitions
a bulk build is already in progress on the databaseDatabase.bulk_begin
no bulk build is in progressDatabase.bulk_add, Database.bulk_finish
a name is empty, the plugin has no call operation with the name, or the plugin refuses the requestDatabase.plugin_call
a name is empty, the plugin has no stream operation with the name, or the plugin refuses the requestDatabase.plugin_stream
the stream has finished or does not accept writesPluginStream.write
the stream does not support reads, or length is negativePluginStream.read
the stream does not support seeks, whence is unknown, or the position is negative or past the i64 rangePluginStream.seek
the stream has finished or has no finish stepPluginStream.finish
the token is empty or longer than 4096 bytesactivate
entity is not a user entityObjects.get, Objects.path
the parent or the name is invalid, or the parent is a fileObjects.lookup
the parent is invalid or is a fileObjects.children
the digest is not 64 hexadecimal digitsObjects.files, Objects.manifest, Objects.open
the array is empty or malformed, a name is invalid, or a parent is a fileObjects.create
the entity is a directory or invalid, the digest is malformed, or expected_revision is negativeObjects.update
the request is malformed, the destination is a file or inside the node, the kinds differ, or a replaced directory is not emptyObjects.move
the entity is invalid, the directory is not empty, or expected_revision is negativeObjects.remove
options is not an object, or an option is invalid, duplicated or unsupportedReactors.sync, Backups.sync, Sdk.sync

"invalid_json"

WhenOperations
JSON text is malformedparse, convert

"compile_failed"

WhenOperations
the expression does not compilebuild
the expansion does not compilebuild_macro
the expanded expression does not compileDatabase.expression

"evaluation_failed"

WhenOperations
the expression fails on the inputProgram.evaluate
the query fails or exceeds max_costQuery.run
the page does not renderRows.next
a page does not renderRows.pages, Rows.all_pages
a rerun of the query failed. Every later call reports this failureSubscription.next
a rerun of the query failedSubscription.events
the mutation failsMutation.run
the plugin cannot read its stored stateDatabase.plugin_call, Database.plugin_stream
stored bytes do not match their digestPluginStream.read
stored tree metadata or the manifest of a named payload is corruptedObjects.get, Objects.lookup, Objects.children, Objects.path
the stored manifest is corruptedObjects.manifest, Objects.open

"out_of_memory"

Codes: out_of_memory.

"not_found"

Codes: not_found.

WhenOperations
the object has no member with the keyDocument.member
the macro refers to an unknown macrobuild_macro, expand_macro
the parent directory is missing, or the file is missing and create is falseopen
no definition is stored at the pathDatabase.query, Database.mutation, Database.definition
no expression is stored at the pathDatabase.expression
the stored query definition was deletedQuery.run
the definition or exact historical plan revision does not existDatabase.plan
the plugin reports that the request names nothing it holdsDatabase.plugin_call, Database.plugin_stream
no object node has the entityObjects.get
the parent has no child with the name, or the parent does not existObjects.lookup
the parent does not existObjects.children
the node or one of its ancestors does not existObjects.path
no payload with the digest is publishedObjects.manifest, Objects.open
a parent does not exist or a digest is not publishedObjects.create
the file does not exist or the digest is not publishedObjects.update
the node or the destination does not existObjects.move
the node does not existObjects.remove

"locked"

WhenOperations
another process holds the lock after lock_timeoutopen

"conflict"

WhenOperations
an enabled plugin finds the database inconsistent with its copies: backups refuse diverging copies with code backup_history_divergent, naming themopen
concurrent writes prevent the commitMutation.run
an entity revision check fails or a concurrent writer prevents the commit; a revision mismatch reports the entity and expected and actual revisionsDatabase.merge_patch
the authored definition or accepted plan changed before the explicit control committedDatabase.plan
another write committed to the database during the buildDatabase.bulk_finish
the plugin's write lost to a concurrent change, or the database holds writesDatabase.plugin_call
the database holds writesDatabase.plugin_stream, PluginStream.finish, Objects.upload
the database holds writes while the plugin stores the bytesPluginStream.write
a name is already taken in its parent or appears twice, or the database holds writesObjects.create
expected_revision is stale, or the database holds writesObjects.update, Objects.remove
the name is occupied without replace, expected_revision is stale, or the database holds writesObjects.move

"invalid_definition"

WhenOperations
the macro is invalid or expands recursivelybuild_macro, expand_macro
the definition is invalidDatabase.query, Database.mutation
a macro it calls is invalid or expands recursivelyDatabase.expression
the loaded query definition is invalidQuery.run
the query or its callable definitions are invalidQuery.subscribe
the mutation selection or definition is invalidMutation.run
the patched definition is invalidDatabase.patch_definition

"schema_violation"

WhenOperations
the write breaks a schemaMutation.run

"invalid_commit_time"

WhenOperations
the #_tx commit time is not later than the last commitDatabase.merge_patch

"closed"

Codes: closed.

"rejected"

WhenOperations
a mutation target or write guard refuses the writeMutation.run
the database refuses the patch; the code and diagnostic path name the reason and keyDatabase.merge_patch
the database refuses the patch; the build has failed and later adds report the same statusDatabase.bulk_add
the database refuses a patch; an initial build publishes nothing and fallback keeps earlier commitsDatabase.bulk_finish

"unsupported"

Codes: abi_version, core_digest.

WhenOperations
found differs from the ABI version of the bindingcheck_version

"cancelled"

Codes: cancelled.

WhenOperations
the subscription is cancelled or closedSubscription.next

"timeout"

WhenOperations
max_wait passed firstDatabase.indexes_sync
the plugin's wait passed its limitDatabase.plugin_call
maxWait passed before the work finishedReactors.sync, Sdk.sync
maxWait passed before every target confirmedBackups.sync

"unavailable"

WhenOperations
an enabled plugin cannot reach what the open needs: backups refuse with backup_targets_unreachable, backup_target_unreadable or backup_objects_requiredopen
the patch sets stardust/history and no enabled plugin purges historyMutation.run, Database.merge_patch
the plugin is unknown or the database does not enable itDatabase.plugin_call, Database.plugin_stream
the database does not enable the objects pluginObjects.get, Objects.lookup, Objects.children, Objects.path, Objects.files, Objects.manifest, Objects.create, Objects.update, Objects.move, Objects.remove, Objects.upload, Objects.open
the database does not enable the reactors pluginReactors.status, Reactors.sync
the database does not enable the backups pluginBackups.status, Backups.sync
the database does not enable the sdk pluginSdk.status, Sdk.sync

"failed"

WhenOperations
the plugin's work failedDatabase.plugin_call
the plugin's work failed; status describes the failureReactors.sync, Backups.sync, Sdk.sync

"unlicensed"

Codes: unlicensed.

WhenOperations
the token is refused; the error names the reasonactivate

Refusal examples

The generator captured each result from the native library.

Describe the backup runtime

python95 B
try:
    await db.backups().status()
except stardust.StardustError as error:
    result = error
TRON226 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0BBC 756E617661696C 61626C65txt "unavailable"
170F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
216C 656E74697479txt "entity"
2800nil
290F 0A 21000000 2800 0000map leaf, size 10: @21 → @28
337C 6D657373616765txt "message"
3B14 19 74686520706C 7567696E20697320 6E6F7420656E6162 6C6564txt "the plugin is not enable…"
560F 0A 33000000 3B00 0000map leaf, size 10: @33 → @3B
6007 0E 08020000 2900 0000 56000000map branch, size 14, depth 1, slots 3, 9: @29 → @56
6E4C 70617468txt "path"
7300nil
740F 0A 6E000000 7300 0000map leaf, size 10: @6E → @73
7E5C 6669656C64txt "field"
8400nil
850F 0A 7E000000 8400 0000map leaf, size 10: @7E → @84
8F4C 636F6465txt "code"
94BC 756E617661696C 61626C65txt "unavailable"
A00F 0A 8F000000 9400 0000map leaf, size 10: @8F → @94
AA6C 6F6666736574txt "offset"
B100nil
B20F 0A AA000000 B100 0000map leaf, size 10: @AA → @B1
BC07 1E 51620000 1700 0000 60000000 7400 0000 85000000 A000 0000 B2000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @17 → @60 → @74 → @85 → @A0 → @B2

Wait until every target stored the history

python203 B
async with await stardust.parse("{maxWait {#dur PT5S}}", "dust") as sync_options:
    try:
        await db.backups().sync(sync_options)
    except stardust.StardustError as error:
        result = error
TRON226 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0BBC 756E617661696C 61626C65txt "unavailable"
170F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
216C 656E74697479txt "entity"
2800nil
290F 0A 21000000 2800 0000map leaf, size 10: @21 → @28
337C 6D657373616765txt "message"
3B14 19 74686520706C 7567696E20697320 6E6F7420656E6162 6C6564txt "the plugin is not enable…"
560F 0A 33000000 3B00 0000map leaf, size 10: @33 → @3B
6007 0E 08020000 2900 0000 56000000map branch, size 14, depth 1, slots 3, 9: @29 → @56
6E4C 70617468txt "path"
7300nil
740F 0A 6E000000 7300 0000map leaf, size 10: @6E → @73
7E5C 6669656C64txt "field"
8400nil
850F 0A 7E000000 8400 0000map leaf, size 10: @7E → @84
8F4C 636F6465txt "code"
94BC 756E617661696C 61626C65txt "unavailable"
A00F 0A 8F000000 9400 0000map leaf, size 10: @8F → @94
AA6C 6F6666736574txt "offset"
B100nil
B20F 0A AA000000 B100 0000map leaf, size 10: @AA → @B1
BC07 1E 51620000 1700 0000 60000000 7400 0000 85000000 A000 0000 B2000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @17 → @60 → @74 → @85 → @A0 → @B2

convert

edn_text holds this document:

TRON24 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
04BC 7B3A612031203A 6120327Dtxt "{:a 1 :a 2}"
python228 B
async with (await stardust.parse(edn_text, "tron")) as edn:
    output = (await edn.read((await edn.root()))).text
try:
    (await stardust.parse(output, "edn")).close()
except stardust.StardustError as error:
    result = error
TRON254 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B14 10 696E76616C69 645F617267756D65 6E74txt "invalid_argument"
1D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
276C 656E74697479txt "entity"
2E00nil
2F0F 0A 27000000 2E00 0000map leaf, size 10: @27 → @2E
397C 6D657373616765txt "message"
4114 27 696E76616C69 642045444E202844 75706C6963617465 5F4B657929206174 206F666673657420 36txt "invalid EDN (Duplicate_K…"
6A0F 0A 39000000 4100 0000map leaf, size 10: @39 → @41
7407 0E 08020000 2F00 0000 6A000000map branch, size 14, depth 1, slots 3, 9: @2F → @6A
824C 70617468txt "path"
8700nil
880F 0A 82000000 8700 0000map leaf, size 10: @82 → @87
925C 6669656C64txt "field"
9800nil
990F 0A 92000000 9800 0000map leaf, size 10: @92 → @98
A34C 636F6465txt "code"
A8BC 696E76616C6964 5F65646Etxt "invalid_edn"
B40F 0A A3000000 A800 0000map leaf, size 10: @A3 → @A8
BE6C 6F6666736574txt "offset"
C502 06000000000000 00i64 6
CE0F 0A BE000000 C500 0000map leaf, size 10: @BE → @C5
D807 1E 51620000 1D00 0000 74000000 8800 0000 99000000 B400 0000 CE000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1D → @74 → @88 → @99 → @B4 → @CE

Refuse a metadata-only transaction

patch_text holds this document:

TRON46 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 617574686F72txt "author"
0B1C 78txt "x"
0D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
174C 235F7478txt "#_tx"
1C0F 0A 17000000 0D00 0000map leaf, size 10: @17 → @D
python177 B
async with (await stardust.parse(patch_text, "tron")) as patch:
    try:
        (await db.merge_patch(patch))
    except stardust.StardustError as error:
        result = error
TRON263 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B8C 72656A65637465 64txt "rejected"
0140F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
01E6C 656E74697479txt "entity"
02500nil
0260F 0A 1E000000 2500 0000map leaf, size 10: @1E → @25
0307C 6D657373616765txt "message"
03814 37 612070617463 68206F66206F6E6C 7920235F74782069 7320726566757365 643A20235F747820 616E6E6F74617465 7320612077726974 65txt "a patch of only #_tx is …"
0710F 0A 30000000 3800 0000map leaf, size 10: @30 → @38
07B07 0E 08020000 2600 0000 71000000map branch, size 14, depth 1, slots 3, 9: @26 → @71
0894C 70617468txt "path"
08E4C 235F7478txt "#_tx"
0930F 0A 89000000 8E00 0000map leaf, size 10: @89 → @8E
09D5C 6669656C64txt "field"
0A300nil
0A40F 0A 9D000000 A300 0000map leaf, size 10: @9D → @A3
0AE4C 636F6465txt "code"
0B314 10 7472616E7361 6374696F6E5F6F6E 6C79txt "transaction_only"
0C50F 0A AE000000 B300 0000map leaf, size 10: @AE → @B3
0CF6C 6F6666736574txt "offset"
0D600nil
0D70F 0A CF000000 D600 0000map leaf, size 10: @CF → @D6
0E107 1E 51620000 1400 0000 7B000000 9300 0000 A4000000 C500 0000 D7000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @14 → @7B → @93 → @A4 → @C5 → @D7

Refuse a repeated commit time

future_text holds this document:

TRON145 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
041C 78txt "x"
0602 01000000000000 00i64 1
0F0F 0A 04000000 0600 0000map leaf, size 10: @4 → @6
194C 23757463txt "#utc"
1E14 14 323230302D30 312D30315430303A 30303A30305Atxt "2200-01-01T00:00:00Z"
340F 0A 19000000 1E00 0000map leaf, size 10: @19 → @1E
3E14 14 737461726475 73742F636F6D6D69 747465644174txt "stardust/committedAt"
540F 0A 3E000000 3400 0000map leaf, size 10: @3E → @34
5E4C 235F7478txt "#_tx"
630F 0A 5E000000 5400 0000map leaf, size 10: @5E → @54
6D3C 235F64txt "#_d"
710F 0A 6D000000 0F00 0000map leaf, size 10: @6D → @F
7B07 0E 08010000 6300 0000 71000000map branch, size 14, depth 0 (root), slots 3, 8: @63 → @71

patch_text holds this document:

TRON145 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
041C 78txt "x"
0602 02000000000000 00i64 2
0F0F 0A 04000000 0600 0000map leaf, size 10: @4 → @6
194C 23757463txt "#utc"
1E14 14 323230302D30 312D30315430303A 30303A30305Atxt "2200-01-01T00:00:00Z"
340F 0A 19000000 1E00 0000map leaf, size 10: @19 → @1E
3E14 14 737461726475 73742F636F6D6D69 747465644174txt "stardust/committedAt"
540F 0A 3E000000 3400 0000map leaf, size 10: @3E → @34
5E4C 235F7478txt "#_tx"
630F 0A 5E000000 5400 0000map leaf, size 10: @5E → @54
6D3C 235F65txt "#_e"
710F 0A 6D000000 0F00 0000map leaf, size 10: @6D → @F
7B07 0E 08010000 6300 0000 71000000map branch, size 14, depth 0 (root), slots 3, 8: @63 → @71
python267 B
async with (await stardust.parse(future_text, "tron")) as future, (await stardust.parse(patch_text, "tron")) as patch:
    (await db.merge_patch(future))
    try:
        (await db.merge_patch(patch))
    except stardust.StardustError as error:
        result = error
TRON290 B
Offset (hex)Bytes (hex)Meaning
00054 52 4F 4Emagic TRON
0046C 737461747573txt "status"
00B14 13 696E76616C69 645F636F6D6D6974 5F74696D65txt "invalid_commit_time"
0200F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
02A6C 656E74697479txt "entity"
03100nil
0320F 0A 2A000000 3100 0000map leaf, size 10: @2A → @31
03C7C 6D657373616765txt "message"
04414 47 737461726475 73742F636F6D6D69 747465644174206D 7573742062652073 74726963746C7920 6E65776572207468 616E20746865206C 617465737420636F 6D6D69742074696D 65txt "stardust/committedAt mus…"
08D0F 0A 3C000000 4400 0000map leaf, size 10: @3C → @44
09707 0E 08020000 3200 0000 8D000000map branch, size 14, depth 1, slots 3, 9: @32 → @8D
0A54C 70617468txt "path"
0AA00nil
0AB0F 0A A5000000 AA00 0000map leaf, size 10: @A5 → @AA
0B55C 6669656C64txt "field"
0BB00nil
0BC0F 0A B5000000 BB00 0000map leaf, size 10: @B5 → @BB
0C64C 636F6465txt "code"
0CB14 13 696E76616C69 645F636F6D6D6974 5F74696D65txt "invalid_commit_time"
0E00F 0A C6000000 CB00 0000map leaf, size 10: @C6 → @CB
0EA6C 6F6666736574txt "offset"
0F100nil
0F20F 0A EA000000 F100 0000map leaf, size 10: @EA → @F1
0FC07 1E 51620000 2000 0000 97000000 AB00 0000 BC000000 E000 0000 F2000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @20 → @97 → @AB → @BC → @E0 → @F2

Refuse an invalid query definition

query_text holds this document:

TRON43 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
042C 3F78txt "?x"
070E 0D 00 0100 010000 00 04000000array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4
144C 66696E64txt "find"
190F 0A 14000000 0700 0000map leaf, size 10: @14 → @7
python210 B
async with (await stardust.parse(query_text, "tron")) as definition:
    try:
        async with (await db.query(definition)):
            pass
    except stardust.StardustError as error:
        result = error
TRON231 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B14 12 696E76616C69 645F646566696E69 74696F6Etxt "invalid_definition"
1F0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
296C 656E74697479txt "entity"
3000nil
310F 0A 29000000 3000 0000map leaf, size 10: @29 → @30
3B7C 6D657373616765txt "message"
4314 10 556E626F756E 645F566172696162 6C65txt "Unbound_Variable"
550F 0A 3B000000 4300 0000map leaf, size 10: @3B → @43
5F07 0E 08020000 3100 0000 55000000map branch, size 14, depth 1, slots 3, 9: @31 → @55
6D4C 70617468txt "path"
7200nil
730F 0A 6D000000 7200 0000map leaf, size 10: @6D → @72
7D5C 6669656C64txt "field"
8300nil
840F 0A 7D000000 8300 0000map leaf, size 10: @7D → @83
8E4C 636F6465txt "code"
9314 10 756E626F756E 645F766172696162 6C65txt "unbound_variable"
A50F 0A 8E000000 9300 0000map leaf, size 10: @8E → @93
AF6C 6F6666736574txt "offset"
B600nil
B70F 0A AF000000 B600 0000map leaf, size 10: @AF → @B6
C107 1E 51620000 1F00 0000 5F000000 7300 0000 84000000 A500 0000 B7000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1F → @5F → @73 → @84 → @A5 → @B7

Report a missing stored query

python127 B
try:
    async with (await db.query("people/missing")):
        pass
except stardust.StardustError as error:
    result = error
TRON237 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B9C 6E6F745F666F75 6E64txt "not_found"
150F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
1F6C 656E74697479txt "entity"
2600nil
270F 0A 1F000000 2600 0000map leaf, size 10: @1F → @26
317C 6D657373616765txt "message"
3914 1A 6E6F20646566 696E6974696F6E20 6174207468697320 70617468txt "no definition at this pa…"
550F 0A 31000000 3900 0000map leaf, size 10: @31 → @39
5F07 0E 08020000 2700 0000 55000000map branch, size 14, depth 1, slots 3, 9: @27 → @55
6D4C 70617468txt "path"
72EC 70656F706C652F 6D697373696E67txt "people/missing"
810F 0A 6D000000 7200 0000map leaf, size 10: @6D → @72
8B5C 6669656C64txt "field"
9100nil
920F 0A 8B000000 9100 0000map leaf, size 10: @8B → @91
9C4C 636F6465txt "code"
A19C 6E6F745F666F75 6E64txt "not_found"
AB0F 0A 9C000000 A100 0000map leaf, size 10: @9C → @A1
B56C 6F6666736574txt "offset"
BC00nil
BD0F 0A B5000000 BC00 0000map leaf, size 10: @B5 → @BC
C707 1E 51620000 1500 0000 5F000000 8100 0000 92000000 AB00 0000 BD000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @15 → @5F → @81 → @92 → @AB → @BD

Report a malformed byte at offset zero

malformed_text holds these bytes:

text1 B
]
python139 B
try:
    async with (await stardust.parse(malformed_text, "dust")):
        pass
except stardust.StardustError as error:
    result = error
TRON242 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B14 10 696E76616C69 645F617267756D65 6E74txt "invalid_argument"
1D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
276C 656E74697479txt "entity"
2E00nil
2F0F 0A 27000000 2E00 0000map leaf, size 10: @27 → @2E
397C 6D657373616765txt "message"
4114 1A 496E76616C69 645F53796E746178 206174206F666673 65742030txt "Invalid_Syntax at offset…"
5D0F 0A 39000000 4100 0000map leaf, size 10: @39 → @41
6707 0E 08020000 2F00 0000 5D000000map branch, size 14, depth 1, slots 3, 9: @2F → @5D
754C 70617468txt "path"
7A00nil
7B0F 0A 75000000 7A00 0000map leaf, size 10: @75 → @7A
855C 6669656C64txt "field"
8B00nil
8C0F 0A 85000000 8B00 0000map leaf, size 10: @85 → @8B
964C 636F6465txt "code"
9BCC 696E76616C6964 5F64757374txt "invalid_dust"
A80F 0A 96000000 9B00 0000map leaf, size 10: @96 → @9B
B26C 6F6666736574txt "offset"
B902 00000000000000 00i64 0
C20F 0A B2000000 B900 0000map leaf, size 10: @B2 → @B9
CC07 1E 51620000 1D00 0000 67000000 7B00 0000 8C000000 A800 0000 C2000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1D → @67 → @7B → @8C → @A8 → @C2

Report malformed DUST

malformed_text holds these bytes:

text1 B
[
python139 B
try:
    async with (await stardust.parse(malformed_text, "dust")):
        pass
except stardust.StardustError as error:
    result = error
TRON242 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
046C 737461747573txt "status"
0B14 10 696E76616C69 645F617267756D65 6E74txt "invalid_argument"
1D0F 0A 04000000 0B00 0000map leaf, size 10: @4 → @B
276C 656E74697479txt "entity"
2E00nil
2F0F 0A 27000000 2E00 0000map leaf, size 10: @27 → @2E
397C 6D657373616765txt "message"
4114 1A 556E65787065 637465645F456E64 206174206F666673 65742032txt "Unexpected_End at offset…"
5D0F 0A 39000000 4100 0000map leaf, size 10: @39 → @41
6707 0E 08020000 2F00 0000 5D000000map branch, size 14, depth 1, slots 3, 9: @2F → @5D
754C 70617468txt "path"
7A00nil
7B0F 0A 75000000 7A00 0000map leaf, size 10: @75 → @7A
855C 6669656C64txt "field"
8B00nil
8C0F 0A 85000000 8B00 0000map leaf, size 10: @85 → @8B
964C 636F6465txt "code"
9BCC 696E76616C6964 5F64757374txt "invalid_dust"
A80F 0A 96000000 9B00 0000map leaf, size 10: @96 → @9B
B26C 6F6666736574txt "offset"
B902 02000000000000 00i64 2
C20F 0A B2000000 B900 0000map leaf, size 10: @B2 → @B9
CC07 1E 51620000 1D00 0000 67000000 7B00 0000 8C000000 A800 0000 C2000000map branch, size 30, depth 0 (root), slots 0, 4, 6, 9, 13, 14: @1D → @67 → @7B → @8C → @A8 → @C2