Skip to content

Commit

Permalink
Warn about not being able to load the $ANY_MOOSE backend
Browse files Browse the repository at this point in the history
  • Loading branch information
sartak committed Apr 2, 2010
1 parent 9d4aecd commit 2fd3990
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Any/Moose.pm
Expand Up @@ -14,6 +14,15 @@ do {
die "ANY_MOOSE is not set to Moose or Mouse"
unless $PREFERRED eq 'Moose'
|| $PREFERRED eq 'Mouse';

# if we die here, then perl gives "unknown error" which doesn't tell
# you what the problem is at all. argh.
if ($PREFERRED eq 'Moose' && !eval { require Moose }) {
warn "\$ANY_MOOSE is set to Moose but we cannot load it";
}
elsif ($PREFERRED eq 'Mouse' && !eval { require Mouse }) {
warn "\$ANY_MOOSE is set to Mouse but we cannot load it";
}
}
elsif (_is_moose_loaded()) {
$PREFERRED = 'Moose';
Expand Down

0 comments on commit 2fd3990

Please sign in to comment.