Prechádzať zdrojové kódy

Add more information about the error in the bbcode structure

Visman 3 rokov pred
rodič
commit
bfb4c413bd
1 zmenil súbory, kde vykonal 3 pridanie a 2 odobranie
  1. 3 2
      app/Models/BBCodeList/Update.php

+ 3 - 2
app/Models/BBCodeList/Update.php

@@ -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 = [