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
The way YamlException messages are worded right now make them pretty confusing to end users that don't know anything about my internal class structure. For example let's say I have the following settings.yml file:
In this case, the settings.yml file is parsed into an object called RecyclarrSettings. If there is no Notifications property in this object, the parser correctly fails with the following YamlException:
Property 'notifications' not found on type 'Recyclarr.Settings.RecyclarrSettings'.
If I surface this exception message to my end users by printing this in the output of my console application, they have no idea how to fix it because they don't know what Recyclarr.Settings.RecyclarrSettings is.
A better message would be something like this:
Property 'notifications' not a valid root node in file `settings.yml`.
Similarly, for nested nodes, it should mention the parent node:
Property 'apprise' not allowed under node 'notifications'.
I think this makes error messages more useful to end users because it focuses more exclusively on the YAML itself instead of internal, non public objects.
Is there a way to contextualize YAML exception messages like this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The way
YamlException
messages are worded right now make them pretty confusing to end users that don't know anything about my internal class structure. For example let's say I have the followingsettings.yml
file:In this case, the
settings.yml
file is parsed into an object calledRecyclarrSettings
. If there is noNotifications
property in this object, the parser correctly fails with the following YamlException:If I surface this exception message to my end users by printing this in the output of my console application, they have no idea how to fix it because they don't know what
Recyclarr.Settings.RecyclarrSettings
is.A better message would be something like this:
Similarly, for nested nodes, it should mention the parent node:
I think this makes error messages more useful to end users because it focuses more exclusively on the YAML itself instead of internal, non public objects.
Is there a way to contextualize YAML exception messages like this?
Beta Was this translation helpful? Give feedback.
All reactions