scrapbook/error

Types

This type represents the reasons why a key or its value could not be found.

pub type FindKeyValueError {
  NoPrefix(key: String)
  FindValueError(FindValueError)
}

Constructors

  • NoPrefix(key: String)

    No prefix with the specified key was found. This may mean that the prefix exists in JSON, but its value does not match the required structure and an attempt to find another occurrence of the key failed.

  • FindValueError(FindValueError)

    Error finding a value.

This type represents the reasons why a value could not be found.

pub type FindValueError {
  NoValue
  NoGraphemes
  InvalidStartCharacter
  NoValueEndFound(IndexSearchError)
}

Constructors

  • NoValue

    The key had no assigned value - the value was null.

  • NoGraphemes

    There were no graphemes in a list after converting from string.

  • InvalidStartCharacter

    Invalid start character of a value - value of the key is not an object or an array.

  • NoValueEndFound(IndexSearchError)

    Error in finding an index that indicates the end character of a value.

This type represents the reasons why the search for the character index in string may fail.

pub type IndexSearchError {
  NoIndexFound(last_index: Int)
}

Constructors

  • NoIndexFound(last_index: Int)

    Error finding an index with an index of a last analyzed character.

This type represents the reasons why decoding of the JSON failed.

pub type PropertyError {
  FindKeyValueError(FindKeyValueError)
  DecodeError(json.DecodeError)
  ValidateError
}

Constructors

  • FindKeyValueError(FindKeyValueError)

    Error in finding the desired key or its value.

  • DecodeError(json.DecodeError)

    Error decoding JSON structure.

  • ValidateError

    Error validating decoded data with the passed validator.

This type represents the reasons why constructing the HTTP request might fail.

pub type RequestError {
  ConstructionError(url: String)
}

Constructors

  • ConstructionError(url: String)

    Error constructing request from URL.

This type represents the reasons why scraping the event might fail.

pub type ScrapeError {
  UrlError
  PropertyError(List(PropertyError))
  RequestError(RequestError)
}

Constructors

  • UrlError

    Error creating the target URL from the input.

  • PropertyError(List(PropertyError))

    Error parsing a JSON property from received HTML.

  • RequestError(RequestError)

    Error constructing the HTTP request.

Search Document