CoolCMS API

PublicFailure
in package

FinalYes

Turns a failed `Result` into a flat bridge response (`{success, errorCode, message}`) that the admin shows in a flash or preview.

For a technical ResultCode::isTechnical() code (text of a DB/ORM/transport exception) the message is not passed on: the detail goes only to the server log, message is empty and the admin shows a generic translated fallback. errorCode stays stable (the domain one from data, otherwise the code name). Deliberate domain messages (validation, state, not found) are passed on unchanged.

Table of Contents

Methods

fromResult()  : array{success: false, errorCode: string, message: string}

Methods

fromResult()

public static fromResult(Result $result[, string $logChannel = 'eshop.general' ]) : array{success: false, errorCode: string, message: string}
Parameters
$result : Result
$logChannel : string = 'eshop.general'
Return values
array{success: false, errorCode: string, message: string}
On this page

Search results