+package CNFExceptionBase;
+use parent 'Exception::Class::Base';
+use Data::Dumper;
+
+
+sub trace {
+ my $self = shift;
+ # Tell Devel::StackTrace to ignore the boring parts
+ return $self->{trace} ||= Devel::StackTrace->new(
+ ignore_package => [ 'Syntax::Keyword::Try' ],
+ );
+}
+
+
+sub full_message {
+ my $self = shift;
+ my $msg = $self->message;
+ my $stack = "";
+ my $tab = " "; # Your defined tab
+
+ # Iterate through each frame in the stack trace
+ if ($self->trace) {
+ foreach my $frame ($self->trace->frames) {
+
+ # 1. Get the list of arguments for this frame
+ my @args = $frame->args;
+ # 2. Stringify arguments (handling refs safely)
+ my $arg_str = join(', ', map {
+ defined $_ ? (ref $_ ? Data::Dumper->new([$_])->Indent(0)->Terse(1)->Dump : "'$_'") : 'undef'
+ } @args);
+
+ # 3. Update your format to include (arg1, arg2...)
+ my $package = $frame->package;
+ my $subroutine = $frame->subroutine;
+ my $filename = $frame->filename;
+ my $line = $frame->line;
+
+ # Apply your specific format
+ $stack .= "$tab $package@($line) $subroutine($arg_str) <- $filename:$line\n";
+ }
+ }
+
+ return "$msg\n$stack";
+}
+
+1;
\ No newline at end of file