Cony v0.2.3 Cony.Parser.ParseError exception View Source
Link to this section Summary
Functions
Simple helper function for generating a ParseError
struct
Link to this section Types
Link to this type
t()
View Source
t() :: %Cony.Parser.ParseError{ __exception__: term(), message: String.t(), type: Cony.variable_type(), value: Cony.variable_value() }
Link to this section Functions
Link to this function
create(type, value, message \\ "invalid value")
View Source
create(Cony.variable_type(), Cony.variable_value(), String.t()) :: t()
Simple helper function for generating a ParseError
struct.
Example
iex> create(:float, "bad value")
%Cony.Parser.ParseError{
type: :float,
value: "bad value",
message: "invalid value"
}
iex> create(:integer, "bad value", "variable is not a number")
%Cony.Parser.ParseError{
type: :integer,
value: "bad value",
message: "variable is not a number"
}