Add log for debug

This commit is contained in:
Bubka 2022-07-14 18:05:19 +02:00
parent 558fd4d9ea
commit 1f9ac91734

View File

@ -454,6 +454,8 @@ class TwoFAccount extends Model implements Sortable
$this->algorithm = self::SHA1; $this->algorithm = self::SHA1;
$this->period = 30; $this->period = 30;
$this->icon = $this->storeImageAsIcon('https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Steam_icon_logo.svg/langfr-320px-Steam_icon_logo.svg.png'); $this->icon = $this->storeImageAsIcon('https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Steam_icon_logo.svg/langfr-320px-Steam_icon_logo.svg.png');
Log::info(sprintf('TwoFAccount configured as Steam account'));
} }
@ -548,7 +550,7 @@ class TwoFAccount extends Model implements Sortable
else { else {
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
Storage::delete($imageFile); Storage::delete($imageFile);
throw new \Exception; throw new \Exception('Unsupported mimeType or missing image on storage');
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
} }
@ -556,6 +558,7 @@ class TwoFAccount extends Model implements Sortable
} }
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
catch (\Assert\AssertionFailedException|\Assert\InvalidArgumentException|\Exception|\Throwable $ex) { catch (\Assert\AssertionFailedException|\Assert\InvalidArgumentException|\Exception|\Throwable $ex) {
Log::error(sprintf('Icon storage failed: %s', $ex->getMessage()));
return null; return null;
} }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd