}
@Override
public void write(Object value, Map<String, Object> attributes, Appendable out) throws IOException {
ClientSideEventException e = (ClientSideEventException) value;
JsonSerializationContext jsonCxt = Aura.getContextService().getCurrentContext().getJsonSerializationContext();
Map<String, Object> serialized = Maps.newHashMap();
serialized.put("exceptionEvent", Boolean.TRUE);
serialized.put("event", e.getEvent());
if (jsonCxt != null && jsonCxt.format()) {
serialized.put("defaultHandler", e.getDefaultHandler());
} else {
serialized.put("defaultHandler", e.getDefaultHandler() == null ? null : e.getDefaultHandler().toString());
}
Json.serialize(serialized, out, jsonCxt);