[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 17/26: [grn,pre-grohtml,troff]: Improve diagnostics.
From: |
G. Branden Robinson |
Subject: |
[groff] 17/26: [grn,pre-grohtml,troff]: Improve diagnostics. |
Date: |
Sat, 13 Jul 2024 16:20:52 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit fe14cf5d8735168ae1b615ab719f8d97b1100c7f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Jul 13 05:05:11 2024 -0500
[grn,pre-grohtml,troff]: Improve diagnostics.
* src/preproc/grn/main.cpp (conv):
* src/preproc/html/pre-html.cpp (get_resolution, get_image_generator):
* src/roff/troff/env.cpp (hyphen_trie::read_patterns_file):
* src/roff/troff/input.cpp (process_macro_package_argument): When
failing to open a file, say why in error diagnostic.
---
ChangeLog | 9 +++++++++
src/preproc/grn/main.cpp | 3 ++-
src/preproc/html/pre-html.cpp | 4 ++--
src/roff/troff/env.cpp | 3 ++-
src/roff/troff/input.cpp | 3 ++-
5 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a4461c1b9..b672fe963 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-07-13 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/preproc/grn/main.cpp (conv):
+ * src/preproc/html/pre-html.cpp (get_resolution)
+ (get_image_generator):
+ * src/roff/troff/env.cpp (hyphen_trie::read_patterns_file):
+ * src/roff/troff/input.cpp (process_macro_package_argument):
+ When failing to open a file, say why in error diagnostic.
+
2024-07-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/eqn/main.cpp (main):
diff --git a/src/preproc/grn/main.cpp b/src/preproc/grn/main.cpp
index 8dab295c0..e5a92f80e 100644
--- a/src/preproc/grn/main.cpp
+++ b/src/preproc/grn/main.cpp
@@ -570,7 +570,8 @@ conv(FILE *fp,
char *path;
gfp = macro_path.open_file(gremlinfile, &path);
if (0 /* nullptr */ == gfp) {
- error("cannot open picture file '%1'", gremlinfile);
+ error("cannot open picture file '%1': %2", gremlinfile,
+ strerror(errno));
return;
}
PICTURE = DBRead(gfp); /* read picture file */
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index c851c6158..0fd9a39c3 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -311,7 +311,7 @@ static unsigned int get_resolution(void)
unsigned int res = 0;
f = font_path.open_file(devps_desc, &pathp);
if (0 /* nullptr */ == f)
- fatal("cannot open file '%1'", devps_desc);
+ fatal("cannot open file '%1': %2", devps_desc, strerror(errno));
free(pathp);
// XXX: We should break out of this loop if we hit a "charset" line.
// "This line and everything following it in the file are ignored."
@@ -337,7 +337,7 @@ static char *get_image_generator(void)
const size_t keyword_len = strlen(keyword);
f = font_path.open_file(devhtml_desc, &pathp);
if (0 /* nullptr */ == f)
- fatal("cannot open file '%1'", devhtml_desc);
+ fatal("cannot open file '%1': %2", devhtml_desc, strerror(errno));
free(pathp);
// XXX: We should break out of this loop if we hit a "charset" line.
// "This line and everything following it in the file are ignored."
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 493a1b3f0..5186f987e 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3946,7 +3946,8 @@ void hyphen_trie::read_patterns_file(const char *name,
int append,
char *path = 0;
FILE *fp = mac_path->open_file(name, &path);
if (0 /* nullptr */ == fp) {
- error("cannot open hyphenation pattern file '%1'", name);
+ error("cannot open hyphenation pattern file '%1': %2", name,
+ strerror(errno));
return;
}
int c = hpf_getc(fp);
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index e4de41c82..69d2efbbd 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8048,7 +8048,8 @@ static void process_macro_package_argument(const char
*mac)
char *path;
FILE *fp = open_macro_package(mac, &path);
if (0 /* nullptr */ == fp)
- fatal("cannot open macro file for -m argument '%1'", mac);
+ fatal("cannot open macro file for -m argument '%1': %2", mac,
+ strerror(errno));
const char *s = symbol(path).contents();
free(path);
input_stack::push(new file_iterator(fp, s));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 17/26: [grn,pre-grohtml,troff]: Improve diagnostics.,
G. Branden Robinson <=