Abstract Wikipedia/Representation of errors

Abstract Wikipedia via mailing list Abstract Wikipedia on IRC Abstract Wikipedia on Telegram Abstract Wikipedia on Twitter Abstract Wikipedia on Facebook Abstract Wikipedia on YouTube Abstract Wikipedia website Translate

Wikifunctions will need a way to report errors for many different reasons, e.g. when the input cannot be interpreted, or when a value cannot be calculated, or when we don't have sufficient resources to calculate a result, or many other reasons.

Every error is a ZObject. Errors will all have the type Z5/Error. An example of an error is given. Here is a simple example.

Assume we ask an evaluation engine to evaluate the following request.

{
 "value": "test"
}
{
 "Z6K1": "test"
}

We should receive an error back as the Z1K1/type is missing on the given ZObject. The exact error might depend on the evaluation engine, but some form of non-well-formedness error should be returned. Here is one possible answer.

{
 "type": "Error",
 "error type": "not well-formed error",
 "error value": {
  "type": "not well-formed error",
  "error type": "missing Z1K1",
  "error value": {
   "type": "missing Z1K1",
   "object": {
    "value": "test"
   }
  }
 }
}
{
 "Z1K1": "Z5",
 "Z5K1": "Z502",
 "Z5K2": {
  "Z1K1": "Z502",
  "Z502K1": "Z523",
  "Z502K2": {
   "Z1K1": "Z523",
   "Z523K1": {
    "Z6K1": "test"
   }
  }
 }
}

This shows a pretty complicated pattern, where a hierarchy of errors allows the system to filter for specific types of errors. So we know that this is an error (like every error, it starts with a Z5/Error).