MediaWiki exception logs look like this in RESTBase; the message will be something like [WqHN@ApAIDMAACBa2EUAAACF] Exception caught: Deleted row returned in non-changes mode. The random-looking string at the beginning is a unique token generated by MediaWiki for finding things in the log; it's good that it gets recorded in some way but it's bad that it's in the message as that breaks grouping by message (for trending errors etc). The error code will just contain the MediaWiki exception class, so grouping by that is not accurate enough. The unique ID should be its own log record field and not part of the message.
RESTBase could just parse it out from the message, or use errorformat=raw in which case the error response will be something like
"errors": [
{
"code": "internal_api_error_LogicException",
"key": "apierror-exceptioncaught",
"params": [
"61ff22d2a7e9df3f52504b06",
"Deleted row returned in non-changes mode"
]
}
]with the first parameter being the exception ID and the second the message. That would change the error response format for non-exception errors as well, though, so maybe more effort to implement.