You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if we could generate user-friendly exceptions from JacksonMappingExceptions. Here is an example exception:
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class io.rakam.ui.service.recipe.Recipe$ExportDashboard] value failed for JSON property name due to missing (therefore NULL) value for creator parameter name which is a non-nullable type
at [Source: (String)"{"fname":"Events Overview","category":"Segment Events","filterSchema":[{"name":"dateRange","type":"mappingDimension","value":{"name":"eventTimestamp"},"defaultValue":"P5Y","isRequired":true}],"reports":[{"name":"Events by Last Seen App Version","ttl":"PT1H","x":0,"y":3,"h":2,"w":6,"component":"r-segmentation-table","type":1,"reportOptions":{"modelName":"segment_events","dimensions":[{"name":"event_text","modelName":"segment_events","relationName":null,"postOperation":null}],"measures":[{"name":""[truncated 2664 chars]; line: 1, column: 3164] (through reference chain: io.rakam.ui.service.recipe.Recipe$ExportDashboard["name"])
Something like the following message that includes JsonPath would be much more helpful to the users:
Parameter .name is required.
We're currently doing this in our web application but since the data mappers have their own exceptions, we need to handle many different cases. It might be a good practice if JsonMappingException could have a method such as getUserFriendlyMessage that allows developers to do it in data-mappers.
The text was updated successfully, but these errors were encountered:
In general I am definitely +1 for improved exception messages.
One major caveat here is that there is no central point with enough information so in many cases improvements need to be made for specific subset of failure cases. On plus side, more and more information is now available via context so that JSONPointer compatible notation can be created (and is in fact produced for many exceptions).
It would be nice if we could generate user-friendly exceptions from
JacksonMappingException
s. Here is an example exception:Something like the following message that includes JsonPath would be much more helpful to the users:
We're currently doing this in our web application but since the data mappers have their own exceptions, we need to handle many different cases. It might be a good practice if
JsonMappingException
could have a method such asgetUserFriendlyMessage
that allows developers to do it in data-mappers.The text was updated successfully, but these errors were encountered: