]> gitweb.factorcode.org Git - factor.git/blob - basis/db/errors/errors.factor
Switch to https urls
[factor.git] / basis / db / errors / errors.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: continuations kernel ;
4 IN: db.errors
5
6 ERROR: db-error ;
7 TUPLE: sql-error location ;
8
9 ERROR: bad-schema ;
10
11 TUPLE: sql-unknown-error < sql-error message ;
12
13 : <sql-unknown-error> ( message -- error )
14     f swap sql-unknown-error boa ;
15
16 TUPLE: sql-table-exists < sql-error table ;
17
18 : <sql-table-exists> ( table -- error )
19     f swap sql-table-exists boa ;
20
21 TUPLE: sql-table-missing < sql-error table ;
22
23 : <sql-table-missing> ( table -- error )
24     f swap sql-table-missing boa ;
25
26 TUPLE: sql-syntax-error < sql-error message ;
27
28 : <sql-syntax-error> ( message -- error )
29     f swap sql-syntax-error boa ;
30
31 TUPLE: sql-function-exists < sql-error message ;
32
33 : <sql-function-exists> ( message -- error )
34     f swap sql-function-exists boa ;
35
36 TUPLE: sql-function-missing < sql-error message ;
37
38 : <sql-function-missing> ( message -- error )
39     f swap sql-function-missing boa ;
40
41 TUPLE: sql-database-exists < sql-error message ;
42
43 : <sql-database-exists> ( message -- error )
44     f swap sql-database-exists boa ;
45
46 TUPLE: sql-index-exists < sql-error name ;
47
48 : <sql-index-exists> ( name -- error )
49     f swap sql-index-exists boa ;
50
51 : ignore-table-exists ( quot -- )
52     [ sql-table-exists? ] ignore-error ; inline
53
54 : ignore-table-missing ( quot -- )
55     [ sql-table-missing? ] ignore-error ; inline
56
57 : ignore-function-exists ( quot -- )
58     [ sql-function-exists? ] ignore-error ; inline
59
60 : ignore-function-missing ( quot -- )
61     [ sql-function-missing? ] ignore-error ; inline
62
63 : ignore-database-exists ( quot -- )
64     [ sql-database-exists? ] ignore-error ; inline
65
66 : ignore-index-exists ( quot -- )
67     [ sql-index-exists? ] ignore-error ; inline