is_integer(year) do (rem(year, 4) == 0 and rem(year, 100) != 0) or rem(year, 400) == 0 end def leapyear?(year) do Logger.warn("Invalid year: #{inspect(year)}") false end end
do (rem(year, 4) == 0 and rem(year, 100) != 0) or rem(year, 400) == 0 end def leapyear?(year) do Logger.warn("Invalid year: #{inspect(year)}") Appsignal.send_error(%RuntimeError{}, "Invalid year: #{inspect(year)}") false end end
do (rem(year, 4) == 0 and rem(year, 100) != 0) or rem(year, 400) == 0 end def leapyear?(year, handler) do Logger.warn("Invalid year: #{inspect(year)}") handler.("Invalid year: #{inspect(year)}") false end end
(rem(year, 4) == 0 and rem(year, 100) != 0) or rem(year, 400) == 0 end def leapyear?(year) do metrics = %{message: "Invalid year: #{inspect(year)}} :telemetry.execute([:leapyear, :invalid_input], metrics) false end end