NaturalDocs::Error

Manages all aspects of error handling in Natural Docs.

Summary
NaturalDocs::ErrorManages all aspects of error handling in Natural Docs.
Variables
FH_CRASHREPORTThe filehandle used for generating crash reports.
stackTraceThe stack trace generated by CatchDeath().
softDeathWhether the program exited using SoftDeath().
currentActionWhat Natural Docs was doing when it crashed.
Functions
SoftDeathGenerates a “soft” death, which means the program exits like with Perl’s die(), but no crash report will be generated.
OnStartParsingCalled whenever NaturalDocs::Parser starts parsing a source file.
OnEndParsingCalled whenever NaturalDocs::Parser is done parsing a source file.
OnStartBuildingCalled whenever NaturalDocs::Builder starts building a source file.
OnEndBuildingCalled whenever NaturalDocs::Builder is done building a source file.
HandleDeathShould be called whenever Natural Docs dies out of execution.
Support Functions
PerlVersionReturns the current Perl version as a string.
GenerateCrashReportGenerates a report and returns the FileName it’s located at.
Signal Handlers
CatchDeathCatches Perl die calls.

Variables

FH_CRASHREPORT

The filehandle used for generating crash reports.

stackTrace

my $stackTrace

The stack trace generated by CatchDeath().

softDeath

my $softDeath

Whether the program exited using SoftDeath().

currentAction

my $currentAction

What Natural Docs was doing when it crashed.  This stores strings generated by functions like OnStartParsing().

Functions

SoftDeath

sub SoftDeath #(message)

Generates a “soft” death, which means the program exits like with Perl’s die(), but no crash report will be generated.

Parameter

messageThe error message to die with.

OnStartParsing

sub OnStartParsing #(FileName file)

Called whenever NaturalDocs::Parser starts parsing a source file.

OnEndParsing

sub OnEndParsing #(FileName file)

Called whenever NaturalDocs::Parser is done parsing a source file.

OnStartBuilding

sub OnStartBuilding #(FileName file)

Called whenever NaturalDocs::Builder starts building a source file.

OnEndBuilding

sub OnEndBuilding #(FileName file)

Called whenever NaturalDocs::Builder is done building a source file.

HandleDeath

sub HandleDeath

Should be called whenever Natural Docs dies out of execution.

Support Functions

PerlVersion

sub PerlVersion

Returns the current Perl version as a string.

GenerateCrashReport

sub GenerateCrashReport

Generates a report and returns the FileName it’s located at.  Returns undef if it could not generate one.

Signal Handlers

CatchDeath

sub CatchDeath #(message)

Catches Perl die calls.

IMPORTANT: This function is a signal handler and should not be called manually.  Also, because of this, it does not have a $self parameter.

Parameters

messageThe error message to die with.
my $stackTrace
The stack trace generated by CatchDeath().
sub CatchDeath #(message)
Catches Perl die calls.
my $softDeath
Whether the program exited using SoftDeath().
sub SoftDeath #(message)
Generates a “soft” death, which means the program exits like with Perl’s die(), but no crash report will be generated.
my $currentAction
What Natural Docs was doing when it crashed.
sub OnStartParsing #(FileName file)
Called whenever NaturalDocs::Parser starts parsing a source file.
A package that coordinates source file parsing between the NaturalDocs::Languages::Base-derived objects and its own sub-packages such as NaturalDocs::Parser::Native.
sub OnEndParsing #(FileName file)
Called whenever NaturalDocs::Parser is done parsing a source file.
sub OnStartBuilding #(FileName file)
Called whenever NaturalDocs::Builder starts building a source file.
A package that takes parsed source file and builds the output for it.
sub OnEndBuilding #(FileName file)
Called whenever NaturalDocs::Builder is done building a source file.
sub HandleDeath
Should be called whenever Natural Docs dies out of execution.
sub PerlVersion
Returns the current Perl version as a string.
sub GenerateCrashReport
Generates a report and returns the FileName it’s located at.
A string representing the absolute, platform-dependent path to a file.
Close