Skip to content

Commit

Permalink
fix(InteractionOutput): adjust implementation to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 20, 2024
1 parent c2bb9a7 commit afab954
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/core/implementation/interaction_output.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ class InteractionOutput implements scripting_api.InteractionOutput {
return _value.internalValue;
}

// TODO(JKRhb): Should a NotReadableError be thrown if schema is null?
// C.f. https://w3c.github.io/wot-scripting-api/#the-value-function
if (schema == null) {
// TODO: Use NotReadableError here
throw Exception(
"Can't convert data to a value because no DataSchema is present.",
);
}

final value = await _contentSerdes.contentToValue(
_content,
Expand Down

0 comments on commit afab954

Please sign in to comment.