Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 96311
Status: resolved
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Moose::Exception public api
Date: Sat, 7 Jun 2014 12:17:25 -0500
To: bugs-moose [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
firstly, I'd suggest a Role perhaps Moose::Throwable or Moose::Exceptional that provides as much implementation as possible, and composes into Moose::Exception. This role should document the things that are hard/impossible to do in a role and how to accomplish them. This is for cases where it might be a good idea to make an object that can't be further subclassed "throwable" I suggest this role provide a Throwable like interface, with things like a throw method, so that we can do ClassName->throw( message => '...' ); or similar, this is in part due to PBP not liking die, but also so you don't have to create a whole subclass for simple exceptions also a few additional generic exception types might be nice. swapping the implementation of confess (that Moose Exports)' ' that's returned to be synonymous for throwing a Moose::Exception with the message set to the param would be awesome. -- Caleb Cushing http://xenoterracide.com Calendar: https://www.google.com/calendar/embed?src=xenoterracide%40gmail.com&ctz=America/Chicago
Subject: Re: Moose::Exception public api
Date: Sat, 7 Jun 2014 13:24:00 -0500
To: bugs-moose [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
note Business::CyberSource::Response would be able to be thrown if this were possible instead of the existence of Business::CyberSource::Exception::Response (soon to be on CPAN at the time of this writing) On Sat, Jun 7, 2014 at 12:17 PM, Caleb Cushing <xenoterracide@gmail.com> wrote: Show quoted text
> firstly, I'd suggest a Role perhaps Moose::Throwable or > Moose::Exceptional that provides as much implementation as possible, > and composes into Moose::Exception. This role should document the > things that are hard/impossible to do in a role and how to accomplish > them. This is for cases where it might be a good idea to make an > object that can't be further subclassed "throwable" > > I suggest this role provide a Throwable like interface, with things > like a throw method, so that we can do ClassName->throw( message => > '...' ); or similar, this is in part due to PBP not liking die, but > also so you don't have to create a whole subclass for simple > exceptions > > > also a few additional generic exception types might be nice. > > swapping the implementation of confess (that Moose Exports)' ' that's > returned to be synonymous for throwing a Moose::Exception with the > message set to the param would be awesome. > > -- > Caleb Cushing > > http://xenoterracide.com > > Calendar: > https://www.google.com/calendar/embed?src=xenoterracide%40gmail.com&ctz=America/Chicago
-- Caleb Cushing http://xenoterracide.com Calendar: https://www.google.com/calendar/embed?src=xenoterracide%40gmail.com&ctz=America/Chicago
We now document that Throwable should be used for external exceptions, rather than the Moose::Exception guts (which is just an inlined version of the relevant bits of Throwable, since we don't want a Moo dependency).