Update deps

This commit is contained in:
Tomasz Rybarczyk 2021-11-08 20:19:24 +01:00
parent da14129b18
commit e344b2c004
3 changed files with 47 additions and 66 deletions

View File

@ -42,18 +42,17 @@
"purescript-nullable": "^v5.0.0",
"purescript-ordered-collections": "^v2.0.1",
"purescript-partial": "^v3.0.0",
"purescript-polyform": "updateTov0.14.1",
"purescript-polyform-batteries-core": "updateTov0.14.1",
"purescript-polyform-batteries-env": "updateTov0.14.1",
"purescript-polyform": "^v0.9.0",
"purescript-polyform-batteries-core": "https://github.com/purescript-polyform/batteries-core.git#v0.2.0",
"purescript-polyform-batteries-env": "https://github.com/purescript-polyform/batteries-env.git#v0.1.0",
"purescript-prelude": "^v5.0.0",
"purescript-psci-support": "^v5.0.0",
"purescript-string-parsers": "^v6.0.0",
"purescript-strings": "^v5.0.0",
"purescript-test-unit": "^v16.0.0",
"purescript-transformers": "^v5.1.0",
"purescript-tuples": "^v6.0.1",
"purescript-typelevel-prelude": "^v6.0.0",
"purescript-validation": "^v5.0.0"
},
"devDependencies": {
"purescript-psci-support": "^v5.0.0",
"purescript-test-unit": "^v16.0.0"
}
}

View File

@ -31,8 +31,8 @@ in upstream
, "validation"
, "variant"
]
, repo = "https://github.com/jordanmartinez/purescript-polyform.git"
, version = "updateTov0.14.1"
, repo = "https://github.com/purescript-polyform/polyform.git"
, version = "v0.9.0"
}
with polyform-batteries-core =
{ dependencies =
@ -55,8 +55,8 @@ in upstream
, "validation"
, "variant"
]
, repo = "https://github.com/jordanmartinez/purescript-polyform-validators.git"
, version = "updateTov0.14.1"
, repo = "https://github.com/purescript-polyform/batteries-core.git"
, version = "v0.2.0"
}
with polyform-batteries-env =
{ dependencies =
@ -70,6 +70,6 @@ in upstream
, "psci-support"
, "typelevel-prelude"
]
, repo = "https://github.com/jordanmartinez/batteries-env.git"
, version = "updateTov0.14.1"
, repo = "https://github.com/purescript-polyform/batteries-env.git"
, version = "v0.1.0"
}

View File

@ -17,7 +17,6 @@ module Database.PostgreSQL
) where
import Prelude
import Control.Monad.Error.Class (catchError, throwError)
import Data.Array (head)
import Data.Bifunctor (lmap)
@ -249,59 +248,42 @@ convertError err = case toMaybe $ ffiSQLState err of
convert s =
if prefix "0A" s then
NotSupportedError
else if prefix "20" s || prefix "21" s then
ProgrammingError
else if prefix "22" s then
DataError
else if prefix "23" s then
IntegrityError
else if prefix "24" s || prefix "25" s then
InternalError
else if prefix "26" s || prefix "27" s || prefix "28" s then
OperationalError
else if prefix "2B" s || prefix "2D" s || prefix "2F" s then
InternalError
else if prefix "34" s then
OperationalError
else if prefix "38" s || prefix "39" s || prefix "3B" s then
InternalError
else if prefix "3D" s || prefix "3F" s then
ProgrammingError
else if prefix "40" s then
TransactionRollbackError
else if prefix "42" s || prefix "44" s then
ProgrammingError
else if s == "57014" then
QueryCanceledError
else if prefix "5" s then
OperationalError
else if prefix "F" s then
InternalError
else if prefix "H" s then
OperationalError
else if prefix "P" s then
InternalError
else if prefix "X" s then
InternalError
else
if prefix "20" s || prefix "21" s then
ProgrammingError
else
if prefix "22" s then
DataError
else
if prefix "23" s then
IntegrityError
else
if prefix "24" s || prefix "25" s then
InternalError
else
if prefix "26" s || prefix "27" s || prefix "28" s then
OperationalError
else
if prefix "2B" s || prefix "2D" s || prefix "2F" s then
InternalError
else
if prefix "34" s then
OperationalError
else
if prefix "38" s || prefix "39" s || prefix "3B" s then
InternalError
else
if prefix "3D" s || prefix "3F" s then
ProgrammingError
else
if prefix "40" s then
TransactionRollbackError
else
if prefix "42" s || prefix "44" s then
ProgrammingError
else
if s == "57014" then
QueryCanceledError
else
if prefix "5" s then
OperationalError
else
if prefix "F" s then
InternalError
else
if prefix "H" s then
OperationalError
else
if prefix "P" s then
InternalError
else
if prefix "X" s then
InternalError
else
const $ ConnectionError s
const $ ConnectionError s
prefix :: String -> String -> Boolean
prefix p = maybe false (_ == 0) <<< String.indexOf (Pattern p)