Allow input mode code to provide custom error messages

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
2024-09-15 10:21:38 -07:00
parent a17ea205c7
commit e7d3e840b3
2 changed files with 24 additions and 15 deletions

View File

@@ -79,9 +79,9 @@ input[type="text"] {
objectLang.ports.parsedString.subscribe(({ string, term }) => {
if (term !== null) {
const query = `type(empty, ${term}, ?tau)`;
app.ports.receiveConverted.send({ input: string, query });
app.ports.receiveConverted.send({ input: string, result: { query } });
} else {
app.ports.receiveConverted.send({ input: string, query: null });
app.ports.receiveConverted.send({ input: string, result: { error: "Unable to parse object language term" } });
}
});