From edc306dcf7729664c878d68a242cd19c889352cc Mon Sep 17 00:00:00 2001 From: Spencer Florence Date: Sun, 11 Jan 2015 20:55:43 -0500 Subject: [PATCH] fail on curl failure (Issue #7) --- private/coveralls.rkt | 9 ++++++--- private/curl.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/private/coveralls.rkt b/private/coveralls.rkt index a3cd17d..9534d25 100644 --- a/private/coveralls.rkt +++ b/private/coveralls.rkt @@ -42,9 +42,12 @@ (if (verbose) (current-output-port) (open-output-nowhere))]) - (void (system* (path->string post) - coverage-file - (if (verbose) "-v" ""))))) + (define result + (system* (path->string post) + coverage-file + (if (verbose) "-v" ""))) + (unless result + (error 'coveralls "request to coveralls failed")))) ;; Maps service name to the environment variable that indicates that the service is to be used. (define BUILD-TYPES (hash "travis-ci" "TRAVIS_JOB_ID")) diff --git a/private/curl.sh b/private/curl.sh index bb19a15..790ccff 100755 --- a/private/curl.sh +++ b/private/curl.sh @@ -3,4 +3,4 @@ file=$1 verbose=$2 -curl $verbose --include --form json_file=@"$file" "https://coveralls.io/api/v1/jobs" +curl $verbose --include --fail --form json_file=@"$file" "https://coveralls.io/api/v1/jobs"