error log updates

This commit is contained in:
Owen
2024-12-17 16:50:45 +01:00
parent 4c090748a8
commit cdfca22248
2 changed files with 20 additions and 5 deletions
+8 -2
View File
@@ -51,6 +51,7 @@ defmodule PlantIdDiscordBot.Cog.PlantNet do
})
end
# TODO remove
Logger.debug(saved_images)
# TODO use actual image data
@@ -74,10 +75,15 @@ defmodule PlantIdDiscordBot.Cog.PlantNet do
})
{:ok, %HTTPoison.Response{status_code: 400}} ->
Logger.error("Malformed request sent to the PlantNet API")
Logger.error("""
Malformed request sent to the PlantNet Api from PlantIdDiscordBot.Cog.PlantNet.do_identification
Query URI: #{query_uri}
Status Code: 400
Response Body: #{String.slice(body, 0..500)}... (truncated)
""")
Api.create_followup_message(interaction.application_id, interaction.token, %{
content: "Bad Request"
content: "Bad Request. This error has been logged."
})
{:ok, %HTTPoison.Response{status_code: 404}} ->