Manual Reference Source Test
import Clinical6Error from 'clinical6/src/utilities/Clinical6Error.js'
public class | source

Clinical6Error

Extends:

ExtendableError → Clinical6Error

Clinical6Error is a class that extends Error so that it can easily translate information from internal SDK errors and platform errors

Test:

Constructor Summary

Public Constructor
public

constructor(message: String, module: String)

Creates an instance of Clinical6Error.

Member Summary

Public Members
public get

code: *

Returns the internal_code from teh platform if it exists

public get

details: *

Splits up the information about the error details into human readable text

public get

Returns the friendly error if it exists

public get

Formats the friendly error to HTML (replaces newline only)

public
public get

Formats the message to HTML (replaces newline only)

public
public get

Returns the response as an object if it's a string object (or object) or simply returns the value

public

source: Any

public get

status: *

Returns the status if the response is an object

Private Members
private
private

Method Summary

Public Methods
public

extractMessage(message: *): String

Extracts information from json to create the error message.

public

Determines if _response is an object

Public Constructors

public constructor(message: String, module: String) source

Creates an instance of Clinical6Error.

Params:

NameTypeAttributeDescription
message String

The message

module String
  • optional
  • default: undefined

The SDK Module

Public Members

public get code: * source

Returns the internal_code from teh platform if it exists

public get details: * source

Splits up the information about the error details into human readable text

public get friendly: * source

Returns the friendly error if it exists

public get friendlyHTML: * source

Formats the friendly error to HTML (replaces newline only)

public message: String source

public get messageHTML: * source

Formats the message to HTML (replaces newline only)

public module: String source

public get response: * source

Returns the response as an object if it's a string object (or object) or simply returns the value

public source: Any source

public get status: * source

Returns the status if the response is an object

Private Members

private _request: Object source

private _response: Object source

Public Methods

public extractMessage(message: *): String source

Extracts information from json to create the error message.

Params:

NameTypeAttributeDescription
message *

Return:

String

an error message with the details and friendly error

public isResponseObject(): Boolean source

Determines if _response is an object

Return:

Boolean

Returns if _response is an object