File tree 2 files changed +8
-0
lines changed 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ net2 = "0.2"
26
26
rotor-test = " 0.1.0"
27
27
url = " 0.5.7"
28
28
argparse = " 0.2.1"
29
+ env_logger = " 0.3.2"
29
30
30
31
[lib ]
31
32
name = " rotor_http"
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ extern crate rotor;
2
2
extern crate rotor_http;
3
3
extern crate argparse;
4
4
extern crate url;
5
+ extern crate env_logger;
5
6
6
7
7
8
use std:: io:: { stdout, stderr} ;
@@ -111,10 +112,16 @@ impl Requester for Req {
111
112
{
112
113
unimplemented ! ( ) ;
113
114
}
115
+ fn bad_response ( self , _scope : & mut Scope < Context > )
116
+ {
117
+ writeln ! ( & mut stderr( ) , "----- Bad response -----" ) . ok ( ) ;
118
+ exit ( 1 ) ;
119
+ }
114
120
}
115
121
116
122
117
123
fn main ( ) {
124
+ env_logger:: init ( ) . unwrap ( ) ;
118
125
let mut url = Url :: parse (
119
126
"http://info.cern.ch/hypertext/WWW/TheProject.html" ) . unwrap ( ) ;
120
127
{
You can’t perform that action at this time.
0 commit comments