Page MenuHomePhabricator

Do not suppress root cause of errors
Closed, ResolvedPublic

Description

Don't know if this has been reported elsewhere already but I couldn't find an equivalent.

Currently some root cause of errors are suppressed and a new error is returned instead.

  • For example this code returns "Could not dereference Z7K1", but that is not very helpful. The underlying error "Generic type function did not return a Z4: {"Z1K1":"Z9","Z9K1":"Z8"}" is much more helpful.

Returning the underlying error, possibly while wrapping it in another error, would be much better. Currently the only way to retrieve this information is to add ad-hoc log messages in the orchestrator while debugging.

Update: the specific instance of this problem linked in this code above has been fixed.

  • Should also examine all other instances of responseEnvelopeContainsError to see if there are any other errors that get discarded. (Note: containsError got renamed to responseEnvelopeContainsError.)

In the following cases, consider whether the result from ValidationStatus.getZ5() should be encapsulated:

  • if ( !validatesAsBoolean( result.Z22K1.asJSON() ).isValid() ) { (builtins.js, line 438)
  • if ( !validatesAsBoolean( headEqualityZ22.Z22K1.asJSON() ).isValid() ) (builtins.js, line 524)

Event Timeline

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

[mediawiki/services/function-orchestrator@master] execute.getArgumentStates: Add inline doc comments with the TODO

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

Change 904573 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] execute.getArgumentStates: Add inline doc comments with the TODO

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

Regarding these 2 cases:

  • if ( !validatesAsBoolean( result.Z22K1.asJSON() ).isValid() ) { (builtins.js, line 438)
  • if ( !validatesAsBoolean( headEqualityZ22.Z22K1.asJSON() ).isValid() ) (builtins.js, line 524)

even though we are not returning the Z5 from the ValidationStatus returned from validatesAsBoolean, that should be okay in these cases. The existing use of Z516 / Argument value error works well to make it clear what the problem is.

Jdforrester-WMF changed the task status from Open to In Progress.Nov 20 2023, 7:16 PM
Jdforrester-WMF assigned this task to DMartin-WMF.
Jdforrester-WMF moved this task from Backlog to In Progress on the Abstract Wikipedia team board.

David to do final check for creation of new envelopes where one already exists, and then declare Resolved.

I had one last look through the code, everywhere that makeMappedResultEnvelope appears; didn't find any other places where an error is discarded.