Skip to content

Instantly share code, notes, and snippets.

@usev6
Created September 27, 2016 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usev6/8d8f77399587404afb6b555134ac479f to your computer and use it in GitHub Desktop.
Save usev6/8d8f77399587404afb6b555134ac479f to your computer and use it in GitHub Desktop.
half-revert 222d16b0b9
diff --git a/src/core/Exception.pm b/src/core/Exception.pm
index d7e2957..ee6f29b3 100644
--- a/src/core/Exception.pm
+++ b/src/core/Exception.pm
@@ -276,6 +276,15 @@ sub EXCEPTION(|) {
elsif $type == nqp::const::CONTROL_RETURN {
$ex := CX::Return.new();
}
+#?if !moar
+ elsif !nqp::isnull_s(nqp::getmessage($vm_ex)) &&
+ nqp::p6box_s(nqp::getmessage($vm_ex)) ~~ /"Method '" (.*?) "' not found for invocant of class '" (.+)\'$/ {
+ $ex := X::Method::NotFound.new(
+ method => ~$0,
+ typename => ~$1,
+ );
+ }
+#?endif
else {
$ex := nqp::create(X::AdHoc);
nqp::bindattr($ex, X::AdHoc, '$!payload', nqp::p6box_s(nqp::getmessage($vm_ex) // 'unknown exception'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment