Closed mrsadeqij closed 7 years ago
All the API Exceptions extend PHP's exceptions. Since PHP enforces numeric-only exception codes you can only use a numeric code. You can use the message to send the details.
The below code will work
ApiError::raiseError(5, "Record not found", 'APINotFoundException');
The documentation was incorrect and did use non-numeric code. I've updated the docs http://techjoomla.github.io/com_api/#error-handling
Hi, I want to use com_api to write an api for the Hikashop component. But when I use
ApiError::raiseError("ERR005", "Record not found", 'APINotFoundException');
I get this error.
Wrong parameters for APINotFoundException([string $message [, long $code [, Throwable $previous = NULL]]])