Skip to content

Commit 290d495

Browse files
committed
Add filename to error message when file format could not be detected
See #1348
1 parent 0a23889 commit 290d495

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/osm2pgsql.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ prepare_input_files(options_t const &options)
6464
if (file.format() == osmium::io::file_format::unknown) {
6565
if (options.input_format.empty()) {
6666
throw std::runtime_error{
67-
"Cannot detect file format. Try using -r."};
67+
"Cannot detect file format for '{}'. Try using -r."_format(
68+
filename)};
6869
}
6970
throw std::runtime_error{
7071
"Unknown file format '{}'."_format(options.input_format)};

0 commit comments

Comments
 (0)