Bunoon: JUST | Manual | Stack Trace

Below is a list of functions which are available as part of the stack trace framework, which is an extension to the JUST framework. This area can be used in your own JavaScript code to get full stack traces when exceptions are thrown, or whenever you require one. The stack traces are always stored so you can obtain every error that has occurred during the run time of your JavaScript, or you can obtain each one as and when you call the store method.

Changes the settings that are used for the stack traces.

The main arguments for this function are as follows:

  • properties [Object] - The properties that determine the settings to use for stack traces.
  • storageName [String] - The storage name we are store the stack traces under (defaults to "Default").
  • statePropertiesAreSet [Boolean] - States if we should state that the properties have been stored (defaults to true).

Below is an example of how to use this function:

$ST.SetupProperties( {

"StoreFullStackTraces": true

} );

Changes all the log display strings that are used to whatever is specified.

The main arguments for this function are as follows:

  • properties [Object] - The properties that determine the strings to be used for the logs.
  • storageName [String] - The storage name we are store the stack traces under (defaults to "Default").
  • stateMessagesAreSet [Boolean] - States if we should state that the messages have been stored (defaults to true).

Below is an example of how to use this function:

$ST.SetupDisplayMessages( {

"Exception": "New Exception"

} );

Builds the full stack trace from the point specified and stores it in the array of stack traces already obtained (by storage name).

The main arguments for this function are as follows:

  • properties [Object] - The properties that determine the settings to use for this stack trace storage (see options below).

    • "Exception" [Object] - The object containing the exception details when the error was thrown.
      • Default: null.

    • "StorageName" [String] - The storage name to store the stack traces under.
      • Default: "Default".

The return value for this function is as follows:

  • [Array] - An array containing the stack trace (or null if nothing has been stored).

Below is an example of how to use this function:

try {

// Your code here

}

catch ( e ) {

$ST.Store( e );

}

Below is an example of how to use this function in any scope:

var stackTrace = $ST.Store();

Clears the stack traces that have been stored during runtime (by storage name).

The main arguments for this function are as follows:

  • storageName [String] - The storage name we have stored the stack traces under (defaults to "Default").

The return value for this function is as follows:

  • [Boolean] - An boolean of true/false to indicate if we have cleared the stack traces.

Below is an example of how to use this function:

$ST.Clear( "MyStorageName" );

Clears all the stack traces that have been stored during runtime (this will also clear all JUST stack traces).

Below is an example of how to use this function:

$ST.ClearAll();

Gets the array of stack traces that have been stored during runtime (by storage name).

The main arguments for this function are as follows:

  • storageName [String] - The storage name we have stored the stack traces under (defaults to "Default").

The return value for this function is as follows:

  • [Array] - An array containing the arrays for each stack trace that has been stored against the storage name.

Below is an example of how to use this function:

var stackTraces = $ST.Get( "MyStorageName" );