Public Functions | |
| public Merror | new (int stackdepth=> 64, string errorfile=> undef, boolean ramusage=> 0) |
| Creates a new Merror object. | |
| public int | error (boolean flag=0) |
| If called with an value != undef the internal state will be considered as an error. If called without a parameter, it will return the internal state where a positive value indicates an error. If called with a value != undef a stacktrace will be created. | |
| public int | ec (int errorCode=0) |
| Returns or sets a error code. | |
| public string | et (string errorDescription="") |
| Returns or sets an error description. | |
| public void | mappedError (int errorcode) |
| Sets the errorcode to the given one and sets the error description from the error mapping file. | |
| public void | stacktrace () |
| Prints out a captured stacktrace in case of error. | |
| public void | merror_copy (Merror to) |
| You could treat this function as a copy operator for Merror objects It copies the complete internal state into a new object. | |
Private Functions | |
| private void | fillstack () |
| Captures the stacktrace with a max depth of $self->{STACKDEPTH}. | |
| private void | parseErrorFile () |
| If user wants to parse the complete error mapping file and save it into ram than this function is called. | |
| private string | mapErrorCode (int errorcode) |
| Returns the error description of the given errorcode. If errorcode is undef than an undefined error will be returned. | |
| public int Merror::ec | ( | int | errorCode = 0 |
) |
Returns or sets a error code.
| errorCode | If a value != undef is given, than this value will be treated as an errorcode If this function is called without a parameter it will return the last set errorCode |
| public int Merror::error | ( | boolean | flag = 0 |
) |
If called with an value != undef the internal state will be considered as an error. If called without a parameter, it will return the internal state where a positive value indicates an error. If called with a value != undef a stacktrace will be created.
| flag | The parameter is optional and should only be set in classes using Merror not in interfaces implementing something |
| public string Merror::et | ( | string | errorDescription = "" |
) |
Returns or sets an error description.
| errorDescription | If a value != undef is given this value will be treated as a string and this string will be the error description. It no value is given than the last set error description will be given back |
| private string Merror::mapErrorCode | ( | int | errorcode | ) |
Returns the error description of the given errorcode. If errorcode is undef than an undefined error will be returned.
| errorcode | The errorcode |
| public void Merror::mappedError | ( | int | errorcode | ) |
Sets the errorcode to the given one and sets the error description from the error mapping file.
| errorcode | The errorcode |
| public void Merror::merror_copy | ( | Merror | to | ) |
You could treat this function as a copy operator for Merror objects It copies the complete internal state into a new object.
| to | The destination hash structure |
| public Merror Merror::new | ( | int | stackdepth, | |
| 64 | , | |||
| string | errorfile, | |||
| undef | , | |||
| boolean | ramusage, | |||
| 0 | ||||
| ) |
Creates a new Merror object.
| stackdepth | Describes how deep the stacktrace should trace back the calls. Default = 64 | |
| errorfile | Path to the file that contains the errorcode to errordescription mapping. Default = undef | |
| ramusage | Describes if set to 1 that the complete errormapping will be held in ram. Default = 0 |
1.5.8