Visual Console Refactor: catching Throwable instead of Exception

Former-commit-id: 34afe6384ebeb54a6384416f8b8116a222dc9069
This commit is contained in:
Alejandro Gallardo Escobar 2019-04-09 16:35:58 +02:00
parent bcab7fb46a
commit 54c9ac82fd
4 changed files with 11 additions and 6 deletions

View File

@ -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;

View File

@ -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;
} }
} }

View File

@ -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());
} }

View File

@ -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');
} }