Adding configuration file, starting with dynamic error codes and messages#25
Adding configuration file, starting with dynamic error codes and messages#25jcoupey merged 4 commits intoVROOM-Project:masterfrom GIScience:master
Conversation
|
Thanks for submitting! I'm 100% in favour of improving the error messages by providing more details the way you did. I'm not sure I totally get the error code part though, as it is already possible to adjust the default values (currently in |
|
Hi @jcoupey - the objective would be to outsource all config information into the
I think it makes it a little cleaner and easier to understand in my opinion. The templates now used for error codes are just a first prototype and I think there might be a cleaner way to do this than initiating the config class again and again. What do you think? |
Agreed, that would be a good improvement. Recreating the objects dynamically is indeed probably not the most efficient way. Maybe we could simply have "global" variables living in What about getting started with:
The rationale for the last one would be that having the relevant message directly generated in the request treatment context might make the whole logic more clear. And hopefully having better messages might also remove the need for customization. ;-) |
|
On a technical level, there are some code syntax changes (and a couple dependency updates), so it looks like you've been using some kind of linting tool. Making this part of the workflow at the project level at some point would be another valuable addition. On the other hand, for the readability of the diffs in this PR, we should probably handle that (before or after) in a dedicated PR. |
|
@jcoupey I refactored towards your suggestions - what do you think? Regarding the linter, I am using https://github.com/jonlabelle/SublimeJsPrettier which uses prettier under the hood. |
|
@TimMcCauley thanks for the refactor! I'll take time for a review. In order to keep the diff focused on the changes you're making, I reverted the parts that are only syntax-related. I also opened #26 to track linting changes, but I'd like to apply them all at once later (with no functional change). |
Providing the ability for users to dynamically use their own error codes which are able to consume custom messages. Happy to discuss and improve.