This commit is contained in:
Daniil Gentili 2017-07-01 16:30:59 +02:00
commit cf9fd67eda

View File

@ -115,7 +115,13 @@ class Lua
public function __call($name, $params)
{
return $this->Lua->{$name}(...$params);
try {
return $this->Lua->{$name}(...$params);
} catch (\danog\MadelineProto\RPCErrorException $e) {
return ['error_code' => $e->getCode(), 'error' => $e->getMessage()];
} catch (\danog\MadelineProto\Exception $e) {
return ['error_code' => $e->getCode(), 'error' => $e->getMessage()];
}
}
public function __set($name, $value)