ShellWords.ParseError exception (ShellWords v0.1.0)

Copy Markdown View Source

Error returned by ShellWords.split/2 and raised by ShellWords.split!/2 when the input cannot be parsed.

Fields:

  • :reason — one of :unterminated_single_quote, :unterminated_double_quote, or :trailing_escape
  • :position — 0-based byte offset into the input binary. For unterminated quotes this is the offset of the opening quote character; for a trailing escape it is the offset of the backslash.
  • :message — human-readable description including the position

All three fields are always populated.

Summary

Types

reason()

@type reason() ::
  :unterminated_single_quote | :unterminated_double_quote | :trailing_escape

t()

@type t() :: %ShellWords.ParseError{
  __exception__: true,
  message: String.t(),
  position: non_neg_integer(),
  reason: reason()
}