Skip to content

FrisbeeError.other #2

@williamhjcho

Description

@williamhjcho

In NetworkGetter.get

do {
    let url = try URLWithQueryBuilder.build(withUrl: url, query: query)
    makeRequest(url: url, onComplete: onComplete)
} catch where type(of: error) == FrisbeeError.self {
    let error = error as? FrisbeeError ?? .unknown
    return onComplete(.fail(error))
} catch {
    return onComplete(.fail(.other(localizedDescription: error.localizedDescription)))
}

Errors are caught and converted to a FrisbeeError

It should allow the propagation of Error instead of wrapping it into a FrisbeeError.other(String) since it could potentially remove some important error properties

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions