ljoaquim 2 semanas atrás
pai
commit
a109527369
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      bin/easycli

+ 5 - 1
bin/easycli

@@ -82,11 +82,15 @@ class CompanyWithUserController
 
             $bin = dirname(__DIR__) . '/bin/easycli';
             $result = BashExecutor::run($bin . ' polygon create-new-address');
-            if (($result['exitCode'] ?? 1) !== 0) {
+            if ((int)($result['exitCode'] ?? 1) !== 0) {
+                $cliOutput = trim((string)($result['output'] ?? ''));
+                $cliError = trim((string)($result['error'] ?? ''));
+                error_log('[CompanyWithUserController] easycli wallet generation failed. Output: ' . $cliOutput . ' | Error: ' . $cliError);
                 $pdo->rollBack();
                 return ResponseLib::sendFail("Wallet generation failed", ['error' => $result['error'] ?? ''], "E_INTERNAL")->withStatus(500);
             }
             $output = trim((string)($result['output'] ?? ''));
+
             $parsed = [];
             foreach (preg_split('/\r?\n/', $output) as $line) {
                 $line = trim($line);