This repository was archived by the owner on Oct 16, 2019. It is now read-only.
File tree 1 file changed +7
-6
lines changed 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import qualified Network.HTTP.Types as Http
19
19
import qualified Network.URI as Uri
20
20
import qualified System.Directory as Directory
21
21
import qualified System.FilePath as Path
22
+ import qualified System.IO as IO
22
23
import qualified Text.Printf as Printf
23
24
24
25
main :: IO ()
@@ -110,15 +111,15 @@ checkLink manager uri = do
110
111
Exception. catch
111
112
(do
112
113
response <- Client. httpNoBody (withUserAgent request) manager
113
- Printf. printf
114
- " - %d %s\n "
115
- (Http. statusCode (Client. responseStatus response))
116
- url
114
+ case Http. statusCode (Client. responseStatus response) of
115
+ 200 -> Printf. printf " - 200 %s\n " url
116
+ code -> IO. hPutStrLn IO. stderr (Printf. printf " - %d %s" code url)
117
117
)
118
118
(\ exception -> case exception of
119
119
Client. HttpExceptionRequest _ x ->
120
- Printf. printf " - 001 %s %s\n " url (show x)
121
- Client. InvalidUrlException _ x -> Printf. printf " - 002 %s %s\n " url x
120
+ IO. hPutStrLn IO. stderr (Printf. printf " - 001 %s %s" url (show x))
121
+ Client. InvalidUrlException _ x ->
122
+ IO. hPutStrLn IO. stderr (Printf. printf " - 002 %s %s" url x)
122
123
)
123
124
124
125
displayUri :: Uri. URI -> String
You can’t perform that action at this time.
0 commit comments