Page MenuHomePhabricator

Incorporate type-smart logic into error type comparison and creation
Closed, ResolvedPublic

Description

Description

Currently, error type equality and error creation on builtin functions is quite primitive:

For Z850:

  • Z850K2 only allows references, as it's lazily evaluated to be able to still get the error type zid and not the dereferenced error type object. Error type comparison cannot be done if the object is dereferenced because it lacks an identity key, so Z850K2 cannot be defined by a other than a Z9.
  • We should build some heuristics to compare two error types similarly to how we do it with Z4s, for which we need Z50s to have an identity key.

For Z851:

  • Errors are created given an error type and a set of string arguments.
  • The error type definition is not checked to make sure that the arguments match the types of the error keys.
  • Only string arguments are allowed, any other argument type is ignored.
  • Error instances produced can hence be wrong (e.g. Z500 can have two keys, when it only defines one), so the responsibility lies in the hands of the editors.

For a sturdier error system:

  • Add identity key to Z50 objects
  • Write error type comparison logic that allows comparing between error types at different level of dereferentiation (recursively down their ID key till something comparable is found)
  • Write error type-aware logic for building error instances

Completion checklist

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
definitions: Add pre-defined test cases for Z850, Z851, Z852 and Z853repos/abstract-wiki/wikifunctions/function-schemata!277genghT405114main
Update function-schemata sub-module to HEAD (e23a73d)repos/abstract-wiki/wikifunctions/function-orchestrator!453jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (e23a73d)repos/abstract-wiki/wikifunctions/function-evaluator!411jforrestersync-function-schematamain
Update function-schemata sub-module to HEAD (e23a73d)repos/abstract-wiki/wikifunctions/wikilambda-cli!89jforrestersync-function-schematamain
definitions: add "is error type" and "get error" builtin functions, and identity keys to error typesrepos/abstract-wiki/wikifunctions/function-schemata!273genghT405114main
Customize query in GitLab

Event Timeline

gengh updated https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-schemata/-/merge_requests/273

definitions: add "is error type" and "get error" builtin functions, and identity keys to error types

gengh updated the task description. (Show Details)

jforrester merged https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-schemata/-/merge_requests/273

definitions: add "is error type" and "get error" builtin functions, and identity keys to error types

Change #1190302 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (e23a73d)

https://gerrit.wikimedia.org/r/1190302

Change #1190302 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (e23a73d)

https://gerrit.wikimedia.org/r/1190302

Change #1190719 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Add Z50K2/error type identity key to constants and mocks

https://gerrit.wikimedia.org/r/1190719

Change #1190719 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add Z50K2/error type identity key to constants and mocks

https://gerrit.wikimedia.org/r/1190719

Change #1191006 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Allow ApiPerformTest to test thrown errors

https://gerrit.wikimedia.org/r/1191006

Change #1191170 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade evaluators from 2025-09-16-190551 to 2025-09-24-083919

https://gerrit.wikimedia.org/r/1191170

Change #1191171 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2025-09-16-134119 to 2025-09-24-180530

https://gerrit.wikimedia.org/r/1191171

Change #1191170 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade evaluators from 2025-09-16-190551 to 2025-09-24-083919

https://gerrit.wikimedia.org/r/1191170

Change #1191171 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2025-09-16-134119 to 2025-09-24-180530

https://gerrit.wikimedia.org/r/1191171

Change #1191006 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Allow ApiPerformTest to test thrown errors

https://gerrit.wikimedia.org/r/1191006

Change #1191448 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (bbfb940)

https://gerrit.wikimedia.org/r/1191448

Change #1191448 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (a31b499)

https://gerrit.wikimedia.org/r/1191448

Change #1192973 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade evaluators from 2025-09-24-083919 to 2025-09-30-194529

https://gerrit.wikimedia.org/r/1192973

Change #1192974 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2025-09-24-180530 to 2025-09-25-181720

https://gerrit.wikimedia.org/r/1192974

Change #1192973 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade evaluators from 2025-09-24-083919 to 2025-09-30-194529

https://gerrit.wikimedia.org/r/1192973

Change #1192974 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2025-09-24-180530 to 2025-09-25-181720

https://gerrit.wikimedia.org/r/1192974