diff options
| author | Eli Zaretskii | 2023-01-15 12:06:54 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-01-15 12:06:54 +0200 |
| commit | 9f5008b9b2af4f96cecff5f878657dc8cad4de80 (patch) | |
| tree | ef2259859ae9dde5ace878af28416f09142985c6 /lisp/sqlite-mode.el | |
| parent | 73b304bb7401da99171fc55ff88352b7c0a07083 (diff) | |
| download | emacs-9f5008b9b2af4f96cecff5f878657dc8cad4de80.tar.gz emacs-9f5008b9b2af4f96cecff5f878657dc8cad4de80.zip | |
Improve error message from sqlite-mode.el
* lisp/sqlite-mode.el (sqlite-mode-open-file): Add error
checking. (Bug#60490)
Diffstat (limited to 'lisp/sqlite-mode.el')
| -rw-r--r-- | lisp/sqlite-mode.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/sqlite-mode.el b/lisp/sqlite-mode.el index 83762b61943..c3047c786f7 100644 --- a/lisp/sqlite-mode.el +++ b/lisp/sqlite-mode.el | |||
| @@ -55,10 +55,14 @@ | |||
| 55 | (interactive "fSQLite file name: ") | 55 | (interactive "fSQLite file name: ") |
| 56 | (unless (sqlite-available-p) | 56 | (unless (sqlite-available-p) |
| 57 | (error "This Emacs doesn't have SQLite support, so it can't view SQLite files")) | 57 | (error "This Emacs doesn't have SQLite support, so it can't view SQLite files")) |
| 58 | (if (file-remote-p file) | ||
| 59 | (error "Remote SQLite files are not yet supported")) | ||
| 58 | (pop-to-buffer (get-buffer-create | 60 | (pop-to-buffer (get-buffer-create |
| 59 | (format "*SQLite %s*" (file-name-nondirectory file)))) | 61 | (format "*SQLite %s*" (file-name-nondirectory file)))) |
| 60 | (sqlite-mode) | 62 | (sqlite-mode) |
| 61 | (setq-local sqlite--db (sqlite-open file)) | 63 | (setq-local sqlite--db (sqlite-open file)) |
| 64 | (unless (sqlitep sqlite--db) | ||
| 65 | (error "`sqlite-open' failed to open SQLite file")) | ||
| 62 | (sqlite-mode-list-tables)) | 66 | (sqlite-mode-list-tables)) |
| 63 | 67 | ||
| 64 | (defun sqlite-mode-list-tables () | 68 | (defun sqlite-mode-list-tables () |