Closed bbkr closed 5 years ago
I agree with this and all its rationales. Things defined by a module should all be in that module's namespace.
I didn't know this ticket existed, so I filed another one: ~https://github.com/perl6/user-experience/issues/11~ perl6/problem-solving#57
This repo will likely be unified with problem-solving in the future, so I'm closing this ticket in favor of the other one.
I think you meant perl6/problem-solving#57
Ah, yes! Thank you!
https://docs.perl6.org/type/Exception
There was discussion on IRC how exceptions should be defined in _user modules_. Current documentation suggests
X::Foo::Bar::What::Happened
butFoo::Bar::X::What::Happened
is better because:X::User::Access::Auth::Invalid
for example - did we have problem with accessing authorization system fromUser
class or did we simply get wrong credentials inUser::Access
class? Defining this asUser::Access::X::Auth::Invalid
makes things explicit - we have separate class for user access and it got wrong credentials.What::Happened
can be defined inFoo::Bar
class and exported.X::
namespace. For example people will be defining exceptions likeX::ParamMissing
and use them inFoo::Bar
class. Exception should be encapsulated. I know that there is:auth
to distinguish package origin but it won't solve the problem.So what is your opinion? Shall we promote in docs
Foo::Bar::X::What::Happened
format (and create issues in modules that useX::
format to refactor them while ecosystem is still young) ?