Add more information about the error in the bbcode structure
This commit is contained in:
parent
7b922096f6
commit
bfb4c413bd
1 changed files with 3 additions and 2 deletions
|
@ -14,6 +14,7 @@ use ForkBB\Models\Method;
|
|||
use ForkBB\Models\BBCodeList\BBCodeList;
|
||||
use ForkBB\Models\BBCodeList\Structure;
|
||||
use RuntimeException;
|
||||
use function \ForkBB\__;
|
||||
|
||||
class Update extends Method
|
||||
{
|
||||
|
@ -22,8 +23,8 @@ class Update extends Method
|
|||
*/
|
||||
public function update(int $id, Structure $structure): BBCodeList
|
||||
{
|
||||
if (null !== $structure->getError()) {
|
||||
throw new RuntimeException('BBCode structure has error');
|
||||
if (null !== ($error = $structure->getError())) {
|
||||
throw new RuntimeException('BBCode structure has error (' . __($error) . ')');
|
||||
}
|
||||
|
||||
$vars = [
|
||||
|
|
Loading…
Add table
Reference in a new issue