There's more than one way to do things | |
PerlMonks |
Re: Error Reporting from Moduleby tobyink (Canon) |
on Oct 09, 2019 at 11:55 UTC ( [id://11107236]=note: print w/replies, xml ) | Need Help?? |
I've looked at your code. My recommendation would be to replace things like this:
With this:
And then define this method:
Then anybody who needs different error handling can subclass your class.
If you have different severities of error message, you may wish to provide multiple methods like log_unrecoverable_error and log_recoverable_error. Whatever makes sense to you. Document these methods, how and when they will be called, etc. This way, people subclassing your module will know that they're not some kind of internal thing that might disappear in the next release, but are a supported part of the API.
In Section
Seekers of Perl Wisdom
|
|