-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
ALL
-
QE 2025-02-03
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
The current result of tojson(new Error("disaster")) is Error : disaster. This is not a valid JSON, because it misses the quotes: "Error : disaster". This is also not a valid JSON.stringify(Error("disaster")) result, because it returns an empty object {} since Error properties are not enumerable.
Probably the best way to fix this is to return Error("disaster") string. This is also not a valid JSON, but it is evaluable similar to other evaluable tojson() results like Timestamp(1242436, 0) or NumberDecimal(13,44).