0 | module Oracle.Types.Error
 1 |
 2 | import Derive.Prelude
 3 |
 4 | %language ElabReflection
 5 |
 6 | ||| Oracle database error returned from ODPI-C.
 7 | |||
 8 | ||| Every Oracle operation that can fail returns an
 9 | ||| `OracleError` describing the underlying Oracle
10 | ||| error code and message.
11 | |||
12 | public export
13 | record OracleError where
14 |   constructor MkOracleError
15 |   code        : Int32
16 |   message     : String
17 |   fnname      : String
18 |   recoverable : Bool
19 |
20 | %runElab derive "OracleError" [Show]
21 |
22 | export
23 | invalidrow : OracleError
24 | invalidrow = MkOracleError (-1)
25 |                            "Row decoding failed"
26 |                            "FromRow"
27 |                            False
28 |