Update Lua.php (#143)

This commit is contained in:
giuseppeM99 2017-07-01 15:07:38 +02:00 committed by Daniil Gentili
parent d8949fb474
commit ae8955d705

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)