Skip to content

Commit

Permalink
Add logging for Font Awesome kits
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Dec 3, 2023
1 parent ef4c029 commit 12fb98e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/iconsets/FontAwesome.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,16 @@ public function getKits(): array
$messageText = (string)$e->getResponse()->getBody()->getContents();
}

$this->_apiError = Craft::t('icon-picker', 'API error: “{message}” {file}:{line}', [
$this->_apiError = Craft::t('icon-picker', '{name} API error: “{message}” {file}:{line}', [
'name' => $this->name,
'message' => $messageText,
'file' => $e->getFile(),
'line' => $e->getLine(),
]);

IconPicker::error($this->_apiError);
}
});
}) ?? [];
}

public function getKit(string $kitId, string $license): array
Expand Down Expand Up @@ -286,11 +289,14 @@ public function getKit(string $kitId, string $license): array
$messageText = (string)$e->getResponse()->getBody()->getContents();
}

$this->_apiError = Craft::t('icon-picker', 'API error: “{message}” {file}:{line}', [
$this->_apiError = Craft::t('icon-picker', '{name} API error: “{message}” {file}:{line}', [
'name' => $this->name,
'message' => $messageText,
'file' => $e->getFile(),
'line' => $e->getLine(),
]);

IconPicker::error($this->_apiError);
}
});
}
Expand Down

0 comments on commit 12fb98e

Please sign in to comment.