@@ -29,7 +29,7 @@ import qualified Data.List.NonEmpty as NonEmpty
2929import qualified Data.Text as T
3030
3131import Control.Exception (IOException)
32−import Web.Bower.PackageMeta (BowerError, PackageName, runPackageName)
32+import Web.Bower.PackageMeta (BowerError, PackageName, runPackageName, showBowerError)
3333import qualified Web.Bower.PackageMeta as Bower
3434
3535import qualified Language.PureScript as P
@@ -55,8 +55,7 @@ data PackageWarning
5555data UserError
5656 = BowerJSONNotFound
5757 | BowerExecutableNotFound [String] -- list of executable names tried
58− | CouldntParseBowerJSON (ParseError BowerError)
59− | BowerJSONNameMissing
58+ | CouldntDecodeBowerJSON (ParseError BowerError)
6059 | TagMustBeCheckedOut
6160 | AmbiguousVersions [Version] -- Invariant: should contain at least two elements
6261 | BadRepositoryField RepositoryFieldError
@@ -130,21 +129,12 @@ displayUserError e = case e of
130129 ])
131130 where
132131 format = intercalate ", " . map show
133− CouldntParseBowerJSON err ->
132+ CouldntDecodeBowerJSON err ->
134133 vcat
135− [ successivelyIndented
136− [ "The bower.json file could not be parsed as JSON:"
137− , "aeson reported: " ++ show err
138− ]
139− , para "Please ensure that your bower.json file is valid JSON."
140− ]
141− BowerJSONNameMissing ->
142− vcat
143− [ successivelyIndented
144− [ "In bower.json:"
145− , "the \"name\" key was not found."
146− ]
147− , para "Please give your package a name first."
134+ [ para "There was a problem with your bower.json file:"
135+ , indented (vcat (map (para . T.unpack) (displayError showBowerError err)))
136+ , spacer
137+ , para "Please ensure that your bower.json file is valid."
148138 ]
149139 TagMustBeCheckedOut ->
150140 vcat