Ken vor 2 Wochen
Ursprung
Commit
448ebf2228
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3 0
      app/Http/Controllers/admin/User.php

+ 3 - 0
app/Http/Controllers/admin/User.php

@@ -117,6 +117,9 @@ class User extends Controller
             return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
         } catch (Exception $e) {
             DB::rollBack();
+            if($e->getCode() == HttpStatus::CUSTOM_ERROR){
+                return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
+            }
             return $this->error(intval($e->getCode()));
         }
         return $this->success(msg: '已完成迁移');