Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
feat(api): Report unknown API request calls (api not found)
Browse files Browse the repository at this point in the history
  • Loading branch information
brasseld committed Oct 29, 2019
1 parent a17d8fc commit 2f13e07
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -57,6 +57,7 @@ public class AnalyticsServiceImpl implements AnalyticsService {
*/
private final Logger logger = LoggerFactory.getLogger(AnalyticsServiceImpl.class);

private static final String UNKNOWN_API = "1";
private static final String APPLICATION_KEYLESS = "1";

@Autowired
Expand Down Expand Up @@ -320,8 +321,13 @@ private Map<String, String> getAPIMetadata(String api) {
metadata.put("name", apiEntity.getName());
metadata.put("version", apiEntity.getVersion());
} catch (ApiNotFoundException anfe) {
metadata.put("name", "Deleted API");
metadata.put("deleted", "true");
metadata.put("name", "Deleted API");
if (api.equals(UNKNOWN_API)) {
metadata.put("name", "Unknown API (not found)");
} else {
metadata.put("name", "Deleted API");
}
}

return metadata;
Expand Down

0 comments on commit 2f13e07

Please sign in to comment.