struct Athena::Dotenv::Exceptions::Format::Context
inherits Struct
#
Stores contextual information related to an Athena::Dotenv::Exceptions::Format
.
begin
dotenv = Athena::Dotenv.new.parse "NAME=Jim\nFOO=BAR BAZ"
rescue ex : Athena::Dotenv::Exceptions::Format
ctx = ex.context
ctx.path # => ".env"
ctx.line_number # => 2
ctx.details # => "...NAME=Jim\nFOO=BAR BAZ...\n ^ line 2 offset 20"
end
Constructors#
Methods#
#details : String
#
Returns a details string that includes the markup before/after the error, along with what line number and offset the error occurred at.