Skip to content

LocalStorageException

class cAlgo.API

DesktopCLICloud

Represents errors that occur during local storage operations. This exception will be passed to cBot / indicator OnException method.

Definition

public sealed class LocalStorageException : Exception

Namespace: cAlgo.API · Group: Local storage

Examples

protected override void OnStart()
{
    LocalStorage.SetString("Last Start", Server.Time.ToString("O"));
}

protected override void OnException(Exception exception)
{
    if (exception is LocalStorageException)
        Print("Local storage error: {0}", exception.Message);
}
def on_start(self):
    api.LocalStorage.SetString("Last Start", api.Server.Time.ToString("O"))

def on_exception(self, exception):
    if isinstance(exception, LocalStorageException):
        api.Print(f"Local storage error: {exception.Message}")

See also