Utility functions for @unitybase/ub-pub module

Members

# isChrome : boolean static

# isGecko : boolean static

# isMac : boolean static

# isNodeJS : boolean static

# isOpera : boolean static

# isReactNative : boolean static

# isSecureBrowser : boolean static

# isWebKit : boolean static

# LDS_KEYS static

localDataStorage keys used by @unitybase-ub-pub (in case of browser environment)

# userAgent : string static

Methods

# log (msg*) static

Log message to console (if console available)

Arguments:
  • msg: *

# logDebug (msg*) static

Log debug message to console. Since it binds to console, can also be used to debug Promise resolving in this way

Arguments:
  • msg: *
  
      UB.get('timeStamp').then(UB.logDebug);
  

# logError (msg*) static

Log error message to console (if console available)

Arguments:
  • msg: *

# logWarn (msg*) static

Log warning message to console (if console available)

Arguments:
  • msg: *

# parseUBError (errMsgstring | object | Error | UBError, errCodeoptstring, entityCodeoptstring, detailstring) → Object static

Parse error and translate message using i18n

Arguments:

# UBAbortError (messageoptstring, detailoptstring) inner

Quiet exception. Global error handler does not show this exception for user. Use it for silently reject promise

Arguments:

# UBError (messagestring, detailoptstring, codeoptnumber) inner

UnityBase client-side exception. Such exceptions will not be showed as unknown error in UB.showErrorWindow

Arguments:
  • message: string

    Message can be either localized message or locale identifier - in this case UB#showErrorWindow translate message using UB#i18n

  • detail: string

    Error details

  • code: number

    Error code (for server-side errors)

  
      // in adminUI will show message box with text:
// "Record was locked by other user. It\'s read-only for you now"
throw new UB.UBError('lockedBy')