By default, Raku's "die" reports the line number where the "die" is located, what if you'd like the line number of the calling context, ala "carp" with perl 5?
What's the raku analog of perl 5's carp?
254 Views Asked by Joseph Brenner At
2
There are 2 best solutions below
0
user0721090601
On
There is now a Carp module available on GitHub and should soon be available in the Raku ecosystem. It currently only supports the most basic functionality, but over time it should be improved.
So the answer to your question is to use Carp like you would in Perl 5. :-)
Related Questions in EXCEPTION
- Python twisted not catching exception
- Proper use of custom exceptions
- C++ Mongodb driver, not working
- C# console application - Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application
- Hashing String (SHA-256) in an ActionListener class
- Do we have to mention exception type in java?
- How can I make Eclipse (or javac) warn about over-inclusive throws clauses
- Why can an Exception not be rethrown in the BackgroundWorker RunWorkerCompleted event
- How can I set the the expected Exception type for a catch statement with a parameter I've passed into a method?
- Why do I get an IndexOutOfBoundsException when my else should prevent it?
- crypto.BadPaddingException: data hash wrong (EKYC-Response)
- How to print the first line from a traceback stack
- java.lang.ArrayIndexOutOfBoundsException object array
- Passing keyword arguments to custom exceptions - anomaly
- Unauthorised access to folders when creating xml file
Related Questions in RAKU
- Use of colon in method and function calls in Perl 6
- How do I create a symbolic link in Perl 6?
- How to build lazy lists with defined generators and is there a "takeWhile" alternative?
- NativeCall code for using Posix forking and piping is not working
- perl6 Unable to initialize a state variable. Help needed
- perl6 How to use adverbs as variables?
- perl6 How to read from stdin and take command line args?
- Does an anonymous parameter in a Perl 6 signature discard the value?
- perl6 what is the best way to enter multiple multi-line here-docs from $*IN
- perl6 How to re-open $*IN for input?
- Simple non-blocking web server
- Why do Perl 6 state variable behave differently for different files?
- perl6-debug-m spawning moar till system thrashes
- How can I call .WHY on a subroutine in a class in Perl 6?
- How can you search Unicode codepoints by name in Perl6?
Related Questions in DIE
- Show a loading symbol whilst running a PHP script
- search result die and redirect
- NetLogo: n-of error when all turtles die
- Will code after eval(die "some error message") continue to be executed?
- Is there a need for die; after print json_encode() when responding to api calls?
- MySQLi update and die(); and exit(); not working
- How to use the same php function in ajax, and non ajax
- Perl built in exit and print in one command
- $.live() and $.die() binding and unbinding
- Why doesn't the die() function work?
- use echo or Die for debugging and logging
- best approach for debugging in PHP and mysql
- PHP - Unable to create file
- atexit(3) in Perl: `END {}` or `$SIG{__DIE__}`?
- register_shutdown_function() and die()
Related Questions in CARP
- CARP hash in Python
- Can't install Carp-1.25
- croaking from a Moose BUILD method
- Infinite loop in perl Carp module
- Is there a C equivalent for Perl's Carp module?
- How can I replace all 'die's with 'confess' in a Perl application?
- Find/Replace using Carp
- How do you catch a buggy sig die handler if the mechanism to debug code that everyone uses overrides it?
- How can I write a SIG{__DIE__} handler that does not trigger in eval blocks?
- Why won't prove accept -MCarp=verbose?
- Carp reporting from the wrong location with @CARP_NOT (Moose and Method Modifiers)
- Overriding croak cluck confess carp from carp module in Perl
- What does Carp::carp do in Perl?
- Perl Carp:confess unit test
- How can I change some specific carps into croaks in Perl?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There is no direct equivalent to
carp, but you can start raku with the--ll-exceptionparameter, which will create a full stack trace on an execution error.I guess nobody has gotten around to creating a
Carpmodule yet. Creating acarpsub shouldn't be too difficult, given that there is aBacktraceclass: