Answer the question
In order to leave comments, you need to log in
How to get status: error (bitrix ajax d7)?
I am using BX.ajax.runComponentAction.
How to generate an error inside the *Action method?
I am trying to throw an Exception but the status is still success. Why?
public function sendMessageAction(): string
{
$i = 0;
try {
if ($i === 0) {
throw new Exception('Ошибка');
}
} catch (Exception $e) {
return (string) $e->getMessage(); // status: success
}
}
Answer the question
In order to leave comments, you need to log in
public function sendMessageAction(): string
{
$i = 0;
if ($i === 0) {
throw new Exception('Ошибка');
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question