-----------------------------------------------------------------------------
-- |
-- Module      :  Distribution.PackageDescription.Utils
--
-- Maintainer  :  cabal-devel@haskell.org
-- Portability :  portable
--
-- Common utils used by modules under Distribution.PackageDescription.*.

module Distribution.PackageDescription.Utils (
  cabalBug, userBug
  ) where

-- ----------------------------------------------------------------------------
-- Exception and logging utils

userBug :: String -> a
userBug :: forall a. String -> a
userBug String
msg = String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> String -> a
forall a b. (a -> b) -> a -> b
$ String
msg String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
". This is a bug in your .cabal file."

cabalBug :: String -> a
cabalBug :: forall a. String -> a
cabalBug String
msg = String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> String -> a
forall a b. (a -> b) -> a -> b
$ String
msg String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
". This is possibly a bug in Cabal.\n"
               String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Please report it to the developers: "
               String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"https://github.com/haskell/cabal/issues/new"