Skip to content

Commit 94a6b7d

Browse files
committed
Better git errors
1 parent 5dd06ae commit 94a6b7d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

spaghetto/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
/.psa*
1111
/.spago
1212
/bin/bundle.js
13+
.direnv

spaghetto/bin/spago.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ package:
2424
bundle:
2525
module: Main
2626
outfile: bundle.js
27-
minify: true
27+
minify: false
2828
platform: node
2929
type: app

spaghetto/src/Spago/Git.purs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ fetchRepo { git, ref } path = do
5454
(runGit_ [ "symbolic-ref", "-q", "HEAD" ] (Just path))
5555

5656
case result of
57-
Left err -> throwError err
57+
Left err -> die
58+
[ "Error while fetching the repo '" <> git <> "' at ref '" <> ref <> "':"
59+
, err
60+
]
5861
Right _ -> pure unit
5962

6063
getRef :: forall a. Spago (GitEnv a) (Either Docc String)

spaghetto/src/Spago/Prelude.purs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module Spago.Prelude
66
, parseUrl
77
, partitionEithers
88
, shaToHex
9-
, throwError
109
, unsafeFromRight
1110
, unsafeLog
1211
, unsafeStringify
@@ -30,9 +29,6 @@ import Registry.Version as Version
3029

3130
import Unsafe.Coerce (unsafeCoerce)
3231

33-
throwError :: forall a m. MonadThrow Error m => String -> m a
34-
throwError = Aff.throwError <<< Aff.error
35-
3632
unsafeFromRight :: forall e a. Either e a -> a
3733
unsafeFromRight v = Either.fromRight' (\_ -> unsafeCrashWith $ "Unexpected Left: " <> unsafeStringify v) v
3834

0 commit comments

Comments
 (0)