PiholeApiFailure class

A failure object thrown by the PiholeApi.

Annotations
  • @freezed

Constructors

PiholeApiFailure.cancelled()
Cancelled by user.
const
factory
PiholeApiFailure.emptyList()
Empty list instead of JSON.
const
factory
PiholeApiFailure.emptyString()
Empty string instead of JSON.
const
factory
PiholeApiFailure.general(String message)
Exposed for custom messages.
const
factory
PiholeApiFailure.hostname()
DNS resolving failed.
const
factory
PiholeApiFailure.invalidResponse(int statusCode)
Unexpected status code.
const
factory
PiholeApiFailure.notAuthenticated()
Authentication failed.
const
factory
PiholeApiFailure.notFound()
Resource not found.
factory
PiholeApiFailure.timeout()
Request timeout.
const
factory
PiholeApiFailure.unknown(dynamic e)
Catch-all default case.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>({required TResult notFound(_NotFound value), required TResult notAuthenticated(_NotAuthenticated value), required TResult invalidResponse(_InvalidResponse value), required TResult emptyString(_EmptyString value), required TResult emptyList(_EmptyList value), required TResult cancelled(_Cancelled value), required TResult timeout(_Timeout value), required TResult hostname(_HostName value), required TResult general(_GeneralApiFailure value), required TResult unknown(_UnknownApiFailure value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult notFound(_NotFound value)?, TResult notAuthenticated(_NotAuthenticated value)?, TResult invalidResponse(_InvalidResponse value)?, TResult emptyString(_EmptyString value)?, TResult emptyList(_EmptyList value)?, TResult cancelled(_Cancelled value)?, TResult timeout(_Timeout value)?, TResult hostname(_HostName value)?, TResult general(_GeneralApiFailure value)?, TResult unknown(_UnknownApiFailure value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult notFound(_NotFound value)?, TResult notAuthenticated(_NotAuthenticated value)?, TResult invalidResponse(_InvalidResponse value)?, TResult emptyString(_EmptyString value)?, TResult emptyList(_EmptyList value)?, TResult cancelled(_Cancelled value)?, TResult timeout(_Timeout value)?, TResult hostname(_HostName value)?, TResult general(_GeneralApiFailure value)?, TResult unknown(_UnknownApiFailure value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult notFound()?, TResult notAuthenticated()?, TResult invalidResponse(int statusCode)?, TResult emptyString()?, TResult emptyList()?, TResult cancelled()?, TResult timeout()?, TResult hostname()?, TResult general(String message)?, TResult unknown(dynamic e)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult notFound(), required TResult notAuthenticated(), required TResult invalidResponse(int statusCode), required TResult emptyString(), required TResult emptyList(), required TResult cancelled(), required TResult timeout(), required TResult hostname(), required TResult general(String message), required TResult unknown(dynamic e)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult notFound()?, TResult notAuthenticated()?, TResult invalidResponse(int statusCode)?, TResult emptyString()?, TResult emptyList()?, TResult cancelled()?, TResult timeout()?, TResult hostname()?, TResult general(String message)?, TResult unknown(dynamic e)?}) → TResult?
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited