mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Visual Console Refactor: catching Throwable instead of Exception
Former-commit-id: 34afe6384ebeb54a6384416f8b8116a222dc9069
This commit is contained in:
parent
bcab7fb46a
commit
54c9ac82fd
@ -291,7 +291,12 @@ final class Container extends Model
|
|||||||
$itemId = (int) $data['id'];
|
$itemId = (int) $data['id'];
|
||||||
$itemType = (int) $data['type'];
|
$itemType = (int) $data['type'];
|
||||||
$class = static::getItemClass($itemType);
|
$class = static::getItemClass($itemType);
|
||||||
\array_push($items, $class::fromDBWithId($itemId));
|
|
||||||
|
try {
|
||||||
|
\array_push($items, $class::fromDBWithId($itemId));
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// TODO: Log this?
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $items;
|
return $items;
|
||||||
|
@ -898,7 +898,7 @@ class Item extends Model
|
|||||||
// No autologin from the public view.
|
// No autologin from the public view.
|
||||||
!$config['public_view']
|
!$config['public_view']
|
||||||
);
|
);
|
||||||
} catch (\Exception $ignored) {
|
} catch (\Throwable $ignored) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1004,7 +1004,7 @@ class Item extends Model
|
|||||||
!$config['public_view']
|
!$config['public_view']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (\Exception $ignored) {
|
} catch (\Throwable $ignored) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1055,7 +1055,7 @@ class Item extends Model
|
|||||||
// No autologin from the public view.
|
// No autologin from the public view.
|
||||||
!$config['public_view']
|
!$config['public_view']
|
||||||
);
|
);
|
||||||
} catch (\Exception $ignored) {
|
} catch (\Throwable $ignored) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ final class Clock extends Item
|
|||||||
$clockData['clockTimezoneOffset'] = $timezone->getOffset(
|
$clockData['clockTimezoneOffset'] = $timezone->getOffset(
|
||||||
$dateTimeUtc
|
$dateTimeUtc
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Throwable $e) {
|
||||||
throw new \InvalidArgumentException($e->getMessage());
|
throw new \InvalidArgumentException($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ final class ColorCloud extends Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Throwable $e) {
|
||||||
throw new \InvalidArgumentException('invalid dynamic data');
|
throw new \InvalidArgumentException('invalid dynamic data');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user