avram icon indicating copy to clipboard operation
avram copied to clipboard

Save constructor parameters as instance variables in AvramError subclasses

Open jochenseeber opened this issue 3 years ago • 0 comments

I would like to localize error messages in show.cr, however e.g. Avram::InvalidOperationError does not allow me to access which operation failed as it only saves an English error message in @message.

If the operation also was saved in an instance variable, I could access it in show.cr and create a nice localized error message. The same holds true for other subclasses of AvramError, e.g. RecordNotFoundError not saving the table and the id in instance variables.

If acceptable, I am willing to create a PR for the AvramError subclasses to save all constructor parameters in instance variables to make them accessible for localization.

jochenseeber avatar Mar 04 '22 16:03 jochenseeber