From RTSC-Pedia
[printable version] [offline version] | offline version generated on 04-Aug-2010 21:08 UTC |
XDCscript - Module-Object.$logError
Log an error from this module
Contents |
Synopsis
| «Mod».$logError(«msg», «obj»[, «prop»]) |
where «Mod» is the module from which the error is sourced.
Parameters
- «msg»
- the string explaining the error
- «obj»
- the typed object that is associated with the error
- «prop»
- (optionally specified) property of «obj» that is associated with the error
Description
A special method that "logs" an error from the module «mod» with message «msg» associated with the typed object «obj». The optional argument, «prop», must be a property of «obj» and allows the module to specifically identify a configuration parameter associated with the error.
Control returns to the caller of $logError so that multiple errors can be logged. Errors logged during the configuration validation phase (or earlier) prevents the generation phase from starting. Errors logged at any time during configuration cause the configuration step to terminate with a non-zero exit status.
Error messages resulting from $logError have the following format:
| error: «Mod»: "«file»", line «num»: «obj» «prop»: «msg» |
where «file» and «line» are the file and line number where the call to $logError occurred.
Example
Mod.xs | |
| if (this.adc10Handler == "" || this.adc10Handler == null) { this.$logError("interrupt handlers must be defined", this, "adc10Handler"); } |
In the event that the error above is triggered, an error message similar to the following will be emitted.
| error: Mod: "Mod.xs", line 8: Mod adc10Handler: interrupt handlers must be defined |
See also
XDCscript - Module-Body.module$validate | Validate current domain object model |
XDCscript - Module-Object.$logFatal | Throw fatal exception from this module |
XDCscript - Module-Object.$logWarning | Log a warning from this module |
[printable version] [offline version] | offline version generated on 04-Aug-2010 21:08 UTC |