-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat/fix: switch from returning undef on error to croaking exceptions…
…, fix setting namespace when creating a function
- Loading branch information
Showing
4 changed files
with
65 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package Extism::Plugin::CallException; | ||
|
||
use 5.016; | ||
use strict; | ||
use warnings; | ||
use version 0.77; our $VERSION = qv(v0.0.1); | ||
use Carp qw(croak shortmess); | ||
our @CARP_NOT = qw(Extism::Plugin); | ||
use overload '""' => sub { | ||
"$_[0]->{message}, code: $_[0]->{code} " . shortmess() | ||
}; | ||
|
||
sub new { | ||
my ($name, $rc, $message) = @_; | ||
my %obj = (code => $rc, message => $message); | ||
bless \%obj, $name | ||
} | ||
|
||
1; # End of Extism::Plugin::CallException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters