IResult
import { type IResult } from '@bitrix24/b24jssdk'Implementation:
Getters
isSuccess
get isSuccess(): booleanIndicates whether the operation was successful (without errors).
Methods
setData
setData(
data: any
): IResultSets the data associated with the result.
Returns the current object for method chaining.
getData
getData(): anyRetrieves the data associated with the result.
Returns the data stored in the result, if any.
addError
addError(
error: Error|string
): IResultAdds an error message or Error object to the result.
Returns the current object for method chaining.
addErrors
addErrors(
errors: (Error|string)[]
): IResultAdds multiple errors to the result in a single call.
Returns the current object for method chaining.
getErrors
getErrors(): IterableIterator<Error>Retrieves an iterator for the errors collected in the result.
Returns an iterator over the stored Error objects.
getErrorMessages
getErrorMessages(): string[]Retrieves an array of error messages from the collected errors.
Returns an array of strings representing the error messages.
toString
toString(): stringConverts the data to a string.
Returns a string representation of the result operation.