zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

error.ex (808B)


      1 defmodule Absinthe.Schema.Error do
      2   @moduledoc """
      3   Exception raised when a schema is invalid
      4   """
      5   defexception phase_errors: []
      6 
      7   def message(error) do
      8     details =
      9       error.phase_errors
     10       |> Enum.map(fn %{message: message, locations: locations} ->
     11         locations =
     12           locations
     13           |> Enum.map(fn
     14             %{line: line, file: file} -> "#{file}:#{line}"
     15             %{column: column, line: line} -> "Column #{column}, Line #{line}"
     16           end)
     17           |> Enum.sort()
     18           |> Enum.join("\n")
     19 
     20         message = String.trim(message)
     21 
     22         """
     23         ---------------------------------------
     24         ## Locations
     25         #{locations}
     26 
     27         #{message}
     28         """
     29       end)
     30       |> Enum.join()
     31 
     32     """
     33     Compilation failed:
     34     #{details}
     35     """
     36   end
     37 end