kraih/mojo — pull request #259 by olegwtf (2012-01-06 15:28:36+00:00)
Title: easier Mojo::Exception subclassing

This commit allows to make exception hierarchy easier.
In the current version we should reimplement throw() in each subclass. This behaviour looks strange.
After this commit we can write smth like:
```
package App::Error;
use base 'Mojo::Exception';

package App::Error::IO;
use base 'App::Error';

package App::Error::HTTP;
use base 'App::Error';

package main;

eval {
-e "mojo.zip" or
App::Error::IO->throw("file not found");
};
if (my $e = $@) {
if ($e->isa('App::Error::HTTP')) {
# ...
}
elsif ($e->isa('App::Error::IO')) {
# ...
}
elsif ($e->isa('App::Error')) {
# ...
}
}
```