scrapbook/error
Types
This type represents the reasons why fetching the HTTP data might fail.
pub type FetchError {
RequestConstructionError(url: String)
HttpError(httpc.HttpError)
FollowRedirectionError
}
Constructors
-
RequestConstructionError(url: String)
Error constructing request from URL.
-
HttpError(httpc.HttpError)
Error sending the HTTP request.
-
FollowRedirectionError
Error following the redirection - no target URL found.
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 scraping the event might fail.
pub type ScrapeError {
UrlError
FetchError(FetchError)
PropertyError(List(PropertyError))
}
Constructors
-
UrlError
Error creating the target URL from the input.
-
FetchError(FetchError)
Error retrieving event data.
-
PropertyError(List(PropertyError))
Error parsing a JSON property from received HTML.