Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
f4572b44
Commit
f4572b44
authored
9 years ago
by
Mikhail Glushenkov
Browse files
Options
Downloads
Plain Diff
Merge pull request #3183 from lspitzner/upload-exitcode
Fix exitcode on `upload`ing failure
parents
a9849144
7875b104
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cabal-install/Distribution/Client/Upload.hs
+16
-9
16 additions, 9 deletions
cabal-install/Distribution/Client/Upload.hs
with
16 additions
and
9 deletions
cabal-install/Distribution/Client/Upload.hs
+
16
−
9
View file @
f4572b44
...
...
@@ -19,6 +19,7 @@ import Network.URI (URI(uriPath), parseURI)
import
Network.HTTP
(
Header
(
..
),
HeaderName
(
..
))
import
System.IO
(
hFlush
,
stdin
,
stdout
,
hGetEcho
,
hSetEcho
)
import
System.Exit
(
exitFailure
)
import
Control.Exception
(
bracket
)
import
System.FilePath
((
</>
),
takeExtension
,
takeFileName
)
import
qualified
System.FilePath.Posix
as
FilePath.Posix
((
</>
))
...
...
@@ -88,11 +89,14 @@ uploadDoc verbosity repoCtxt mUsername mPassword path = do
notice
verbosity
$
"Uploading documentation "
++
path
++
"... "
resp
<-
putHttpFile
transport
verbosity
uploadURI
path
auth
headers
case
resp
of
(
200
,
_
)
->
notice
verbosity
"Ok"
(
code
,
err
)
->
notice
verbosity
$
"Error uploading documentation "
++
path
++
": "
++
"http code "
++
show
code
++
"
\n
"
++
err
(
200
,
_
)
->
notice
verbosity
"Ok"
(
code
,
err
)
->
do
notice
verbosity
$
"Error uploading documentation "
++
path
++
": "
++
"http code "
++
show
code
++
"
\n
"
++
err
exitFailure
promptUsername
::
IO
Username
promptUsername
=
do
...
...
@@ -150,7 +154,10 @@ handlePackage :: HttpTransport -> Verbosity -> URI -> Auth
handlePackage
transport
verbosity
uri
auth
path
=
do
resp
<-
postHttpFile
transport
verbosity
uri
path
auth
case
resp
of
(
200
,
_
)
->
notice
verbosity
"Ok"
(
code
,
err
)
->
notice
verbosity
$
"Error uploading "
++
path
++
": "
++
"http code "
++
show
code
++
"
\n
"
++
err
(
200
,
_
)
->
notice
verbosity
"Ok"
(
code
,
err
)
->
do
notice
verbosity
$
"Error uploading "
++
path
++
": "
++
"http code "
++
show
code
++
"
\n
"
++
err
exitFailure
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment