Rename non-schema-specific roles to SQLT::Role::Foo
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Role / Error.pm
CommitLineData
45595850 1package SQL::Translator::Role::Error;
5f7fd749 2use Moo::Role;
3
4has error => (is => 'rw', default => sub { '' });
5
6around error => sub {
7 my ($orig, $self) = (shift, shift);
8
45287c81 9 # Emulate horrible Class::Base API
10 unless (ref ($self)) {
11 my $errref = do { no strict 'refs'; \${"${self}::_ERROR"} };
12 return $$errref unless @_;
13 $$errref = $_[0];
14 return undef;
15 }
16
5f7fd749 17 return $self->$orig unless @_;
45287c81 18 $self->$orig(@_);
5f7fd749 19 return undef;
20};
21
221;