Rewrite the Error type. (#234)
This adds a source field to keep track of upstream errors and allow
backtraces, plus a URL field to indicate what URL an error was
associated with.
The enum variants we used to use for Error are now part of a new
ErrorKind type. For convenience within ureq, ErrorKinds can be turned
into an Error with `.new()` or `.msg("some additional information")`.
Error acts as a builder, so additional information can be added after
initial construction. For instance, we return a DnsFailed error when
name resolution fails. When that error bubbles up to Request's
`do_call`, Request adds the URL.
Fixes #232.
This commit is contained in:
committed by
GitHub
parent
dac517e30e
commit
fade03b54e
@@ -1,10 +1,10 @@
|
||||
use crate::error::Error;
|
||||
use crate::stream::Stream;
|
||||
use crate::unit::Unit;
|
||||
use crate::{error::Error};
|
||||
use crate::{stream::Stream};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::collections::HashMap;
|
||||
use std::io::{Cursor, Write};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::{collections::HashMap};
|
||||
|
||||
mod agent_test;
|
||||
mod body_read;
|
||||
|
||||
Reference in New Issue
Block a user