]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
fix(ERP-243): catch all exceptions in TimetableService transaction rollback origin/feature_filippov_ERP-243_fix_timetable_transaction
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Thu, 26 Feb 2026 19:58:14 +0000 (22:58 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Thu, 26 Feb 2026 19:58:14 +0000 (22:58 +0300)
catch (Exception) only caught yii\db\Exception, missing
InvalidArgumentException from validation/upload errors. This left
orphaned timetable records with tabel=1 but no timetable_fact entry,
blocking shift reopening.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
erp24/api3/core/services/TimetableService.php

index 6449af934a21f06c0cb8045ab5abf6dcc21fe6cb..953d6748cd3700eb75187c6f9c185dc6f308f16f 100644 (file)
@@ -101,7 +101,7 @@ class TimetableService
             }
 
             $transaction->commit();
-        } catch (Exception $e) {
+        } catch (\Throwable $e) {
             $transaction->rollBack();
             throw $e;
         }
@@ -222,7 +222,7 @@ class TimetableService
             }
 
             $transaction->commit();
-        } catch (Exception $e) {
+        } catch (\Throwable $e) {
             $transaction->rollBack();
             throw $e;
         }