{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
module PlutusTx.ErrorCodes where

import Data.Map (Map)
import Data.Map qualified as Map
import PlutusTx.Builtins as Builtins
import Prelude (String)

{-
All error codes in this module should be unique and can be used only once!
They help to trace the errors in on-chain code.
-}

{- Note [allErrorCodes]
   This list contains all error codes used in the plutus prelude and it is
   important that when an error code is added to the prelude it is also added
   to this list.
-}

-- | A list of all error codes used in the plutus prelude
allErrorCodes :: Map Builtins.BuiltinString String
allErrorCodes :: Map BuiltinString String
allErrorCodes = [(BuiltinString, String)] -> Map BuiltinString String
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [ (BuiltinString
"PT1", String
"TH Generation of Indexed Data Error")
                             , (BuiltinString
"PT2", String
"Void is not supported")
                             , (BuiltinString
"PT3", String
"Ratio number can't have a zero denominator")
                             , (BuiltinString
"PT4", String
"'round' got an incorrect input")
                             , (BuiltinString
"PT5", String
"'check' input is 'False'")
                             , (BuiltinString
"PT6", String
"PlutusTx.List.!!: negative index")
                             , (BuiltinString
"PT7", String
"PlutusTx.List.!!: index too large")
                             , (BuiltinString
"PT8", String
"PlutusTx.List.head: empty list")
                             , (BuiltinString
"PT9", String
"PlutusTx.List.tail: empty list")
                             , (BuiltinString
"PT10", String
"PlutusTx.Enum.().succ: bad argument")
                             , (BuiltinString
"PT11", String
"PlutusTx.Enum.().pred: bad argument")
                             , (BuiltinString
"PT12", String
"PlutusTx.Enum.().toEnum: bad argument")
                             , (BuiltinString
"PT13", String
"PlutusTx.Enum.Bool.succ: bad argument")
                             , (BuiltinString
"PT14", String
"PlutusTx.Enum.Bool.pred: bad argument")
                             , (BuiltinString
"PT15", String
"PlutusTx.Enum.Bool.toEnum: bad argument")
                             , (BuiltinString
"PT16", String
"PlutusTx.Enum.Ordering.succ: bad argument")
                             , (BuiltinString
"PT17", String
"PlutusTx.Enum.Ordering.pred: bad argument")
                             , (BuiltinString
"PT18", String
"PlutusTx.Enum.Ordering.toEnum: bad argument")
                             ]

-- | The error happens in TH generation of indexed data
{-# INLINABLE reconstructCaseError #-}
reconstructCaseError :: Builtins.BuiltinString
reconstructCaseError :: BuiltinString
reconstructCaseError = BuiltinString
"PT1"

-- | Error case of 'unsafeFromBuiltinData'
{-# INLINABLE voidIsNotSupportedError #-}
voidIsNotSupportedError :: Builtins.BuiltinString
voidIsNotSupportedError :: BuiltinString
voidIsNotSupportedError = BuiltinString
"PT2"

-- | Ratio number can't have a zero denominator
{-# INLINABLE ratioHasZeroDenominatorError #-}
ratioHasZeroDenominatorError :: Builtins.BuiltinString
ratioHasZeroDenominatorError :: BuiltinString
ratioHasZeroDenominatorError = BuiltinString
"PT3"

-- | 'round' got an incorrect input
{-# INLINABLE roundDefaultDefnError #-}
roundDefaultDefnError :: Builtins.BuiltinString
roundDefaultDefnError :: BuiltinString
roundDefaultDefnError = BuiltinString
"PT4"

-- | 'check' input is 'False'
{-# INLINABLE checkHasFailedError #-}
checkHasFailedError :: Builtins.BuiltinString
checkHasFailedError :: BuiltinString
checkHasFailedError = BuiltinString
"PT5"

-- | PlutusTx.List.!!: negative index
{-# INLINABLE negativeIndexError #-}
negativeIndexError :: Builtins.BuiltinString
negativeIndexError :: BuiltinString
negativeIndexError = BuiltinString
"PT6"

-- | PlutusTx.List.!!: index too large
{-# INLINABLE indexTooLargeError #-}
indexTooLargeError :: Builtins.BuiltinString
indexTooLargeError :: BuiltinString
indexTooLargeError = BuiltinString
"PT7"

-- | PlutusTx.List.head: empty list
{-# INLINABLE headEmptyListError #-}
headEmptyListError :: Builtins.BuiltinString
headEmptyListError :: BuiltinString
headEmptyListError = BuiltinString
"PT8"

-- | PlutusTx.List.tail: empty list
{-# INLINABLE tailEmptyListError #-}
tailEmptyListError :: Builtins.BuiltinString
tailEmptyListError :: BuiltinString
tailEmptyListError = BuiltinString
"PT9"

-- | PlutusTx.Enum.().succ: bad argument
{-# INLINABLE succVoidBadArgumentError #-}
succVoidBadArgumentError :: Builtins.BuiltinString
succVoidBadArgumentError :: BuiltinString
succVoidBadArgumentError = BuiltinString
"PT10"

-- | PlutusTx.Enum.().pred: bad argument
{-# INLINABLE predVoidBadArgumentError #-}
predVoidBadArgumentError :: Builtins.BuiltinString
predVoidBadArgumentError :: BuiltinString
predVoidBadArgumentError = BuiltinString
"PT11"

-- | PlutusTx.Enum.().toEnum: bad argument
{-# INLINABLE toEnumVoidBadArgumentError #-}
toEnumVoidBadArgumentError :: Builtins.BuiltinString
toEnumVoidBadArgumentError :: BuiltinString
toEnumVoidBadArgumentError = BuiltinString
"PT12"

-- | PlutusTx.Enum.Bool.succ: bad argument
{-# INLINABLE succBoolBadArgumentError #-}
succBoolBadArgumentError :: Builtins.BuiltinString
succBoolBadArgumentError :: BuiltinString
succBoolBadArgumentError = BuiltinString
"PT13"

-- | PlutusTx.Enum.Bool.pred: bad argument
{-# INLINABLE predBoolBadArgumentError #-}
predBoolBadArgumentError :: Builtins.BuiltinString
predBoolBadArgumentError :: BuiltinString
predBoolBadArgumentError = BuiltinString
"PT14"

-- | PlutusTx.Enum.Bool.toEnum: bad argument
{-# INLINABLE toEnumBoolBadArgumentError #-}
toEnumBoolBadArgumentError :: Builtins.BuiltinString
toEnumBoolBadArgumentError :: BuiltinString
toEnumBoolBadArgumentError = BuiltinString
"PT15"

-- | PlutusTx.Enum.Ordering.succ: bad argument
{-# INLINABLE succOrderingBadArgumentError #-}
succOrderingBadArgumentError :: Builtins.BuiltinString
succOrderingBadArgumentError :: BuiltinString
succOrderingBadArgumentError = BuiltinString
"PT16"

-- | PlutusTx.Enum.Ordering.pred: bad argument
{-# INLINABLE predOrderingBadArgumentError #-}
predOrderingBadArgumentError :: Builtins.BuiltinString
predOrderingBadArgumentError :: BuiltinString
predOrderingBadArgumentError = BuiltinString
"PT17"

-- | PlutusTx.Enum.Ordering.toEnum: bad argument
{-# INLINABLE toEnumOrderingBadArgumentError #-}
toEnumOrderingBadArgumentError :: Builtins.BuiltinString
toEnumOrderingBadArgumentError :: BuiltinString
toEnumOrderingBadArgumentError = BuiltinString
"PT18"