The spec requires errors to be a single string, and also mandates using the space character as a separator? I’m not a fan of deviating from spec, but those are…bad choices in the spec.
The spec requires errors to be a single string, and also mandates using the space character as a separator? I’m not a fan of deviating from spec, but those are…bad choices in the spec.
the function reads the comment added after the function is called using a backtrace and uses them as arguments
How marvelously creative. What an abomination.
Yeah, consistency is good, which is why it’s good to follow the spec. I’m saying that the decision to make errors be flat strings in the spec was a bad one. A better design would be what you have, where
code
is nested one level belowerror
, plus permitting extra implementation-defined fields in that object.