aboutsummaryrefslogtreecommitdiff
path: root/c/data.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-09-07 23:33:08 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-09-07 23:33:08 +0200
commitb5917be252caf9d38ae9466352c4176ef25732e3 (patch)
tree8eee2398b84cd533999a6d6f7539131daef5acfd /c/data.h
parentac7d676a1c457f71f1d3ae17d74699dd95c9c985 (diff)
downloadEpisodeBrowser-b5917be252caf9d38ae9466352c4176ef25732e3.tar.gz
Simplify Err message format.
Diffstat (limited to 'c/data.h')
-rw-r--r--c/data.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/c/data.h b/c/data.h
index b2eb2a0..0d1bee0 100644
--- a/c/data.h
+++ b/c/data.h
@@ -131,9 +131,9 @@ struct FileView
hf = CreateFile(filename, GENERIC_READ|GENERIC_WRITE,
0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hf.Bad(INVALID_HANDLE_VALUE))
- throw Err(WINDOWS, L"File "s + filename + L" could not be created: %s.");
+ throw Err(WINDOWS, L"File "s + filename + L" could not be created");
} else
- throw Err(WINDOWS, L"File "s + filename + L" could not be opened: %s.");
+ throw Err(WINDOWS, L"File "s + filename + L" could not be opened");
}
LARGE_INTEGER cbMap;
@@ -141,11 +141,11 @@ struct FileView
hm = CreateFileMapping(hf.v, nullptr, PAGE_READWRITE,
cbMap.HighPart, cbMap.LowPart, nullptr);
if (hm.Bad(0))
- throw Err(WINDOWS, L"File mapping for "s + filename + L" could not be created: %s.");
+ throw Err(WINDOWS, L"File mapping for "s + filename + L" could not be created");
view = reinterpret_cast<T*>(MapViewOfFile(hm.v, FILE_MAP_ALL_ACCESS, 0, 0, 0));
if (view.Bad(0))
- throw Err(WINDOWS, L"View for "s + filename + L"could not be mapped: %s.");
+ throw Err(WINDOWS, L"View for "s + filename + L"could not be mapped");
}
/* Access element by index, performing bounds check and, if
@@ -155,7 +155,7 @@ struct FileView
{
if (i >= c)
throw Err(GENERIC, L"Element in "s + filename +
- L" could not be accessed: Index larger than buffer.");
+ L" could not be accessed: Index larger than buffer");
T& t = view.v[i];
@@ -165,7 +165,7 @@ struct FileView
memcpy(&t, &t_, sizeof(T));
} else if (t.version != Version<T>)
throw Err(GENERIC, L"Element in "s + filename +
- L" could not be accessed: Invalid format version.");
+ L" could not be accessed: Invalid format version");
}
/* TODO: Use a custom exception type that informs the