Packages

An extended and functional wrapper for the Clash of Clans API

Current section

Files

Jump to
clashofclans lib api errors maintenance.ex
Raw

lib/api/errors/maintenance.ex

defmodule Api.Errors.Maintenance do
@moduledoc """
Check if the API request failed due to a maintenance break.
"""
def on_maintenance(data) do
if data["reason"] == "inMaintenance" do
{:error, "The API is currently on undergoing maintenance"}
else
{:ok, data}
end
end
end