Source
Map serialize() {
Map rslt = {};
if (msg != null) {
rslt["msg"] = msg;
}
if (type != null) {
rslt["type"] = type;
}
if (path != null) {
rslt["path"] = path;
}
if (phase == ErrorPhase.request) {
rslt["phase"] = ErrorPhase.request;
}
if (detail != null) {
rslt["detail"] = detail;
}
return rslt;
}