[Bug 21685] New: Name our exceptions consistently
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21685 Bug ID: 21685 Summary: Name our exceptions consistently Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Few examples of inconsistencies: * Koha::Exceptions::WrongParameter Koha::Exceptions::BadParameter * Koha::Exceptions::CannotDeleteDefault Koha::Exceptions::Patron::FailedDelete * Koha::Exceptions::Account::IsNotCredit Koha::Exceptions::Password::Invalid => IsNotCredit vs NotCredit => IsNotValid vs Invalid vs NotValid * Koha::Exceptions::DuplicateObject Koha::Exceptions::Object::DuplicateID It would be good a write a guideline and adapt existing occurrences. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21685 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21685 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21337 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21685 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com, | |m.de.rooy@rijksmuseum.nl, | |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com Status|NEW |In Discussion --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- CCing some of you, how do you feel about that? Any good practices you have in mind? It would be good to have something on the wiki. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21685 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Agreed it would be nice to build a consistent pattern and add a guideline to help work towards that... we also don't always subclass and so exceptions are hard to find sometimes which I think is what leads to the nearly duplicate ones you have discovered. I'd even go so far as to ask the question of whether it's worth us starting to take on a more consistent approach with our objects in general.. We already actually have Moo as a dependency, we could start using some of its recommendations today if we wanted to for type checking etc. We're also doing a poor mans version of method signatures in a few cases now.. perhaps we should start advocating something there too? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21685 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Martin Renvoize from comment #2)
I'd even go so far as to ask the question of whether it's worth us starting to take on a more consistent approach with our objects in general.. We already actually have Moo as a dependency, we could start using some of its recommendations today if we wanted to for type checking etc. We're also doing a poor mans version of method signatures in a few cases now.. perhaps we should start advocating something there too?
To clarify that a bit.. I'm thinking of something along the lines of Function::Parameters + Type::Tiny -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org