summaryrefslogtreecommitdiffstats
path: root/toolkit/crashreporter/process_reader/src/error.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:18:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:18:09 +0000
commit0cd6f26b6b8fcec2b43398fd831f6b9e0cb977e3 (patch)
tree673eec8dca4c4cfc5125dd4447f6608e589fa6b9 /toolkit/crashreporter/process_reader/src/error.rs
parentAdding debian version 115.8.0esr-1~deb12u1. (diff)
downloadfirefox-esr-0cd6f26b6b8fcec2b43398fd831f6b9e0cb977e3.tar.xz
firefox-esr-0cd6f26b6b8fcec2b43398fd831f6b9e0cb977e3.zip
Merging upstream version 115.9.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/process_reader/src/error.rs')
-rw-r--r--toolkit/crashreporter/process_reader/src/error.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/toolkit/crashreporter/process_reader/src/error.rs b/toolkit/crashreporter/process_reader/src/error.rs
new file mode 100644
index 0000000000..af4d803a7a
--- /dev/null
+++ b/toolkit/crashreporter/process_reader/src/error.rs
@@ -0,0 +1,30 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+use thiserror::Error;
+
+#[derive(Debug, Error)]
+pub enum ProcessReaderError {
+ #[error("Could not convert address {0}")]
+ ConvertAddressError(#[from] std::num::TryFromIntError),
+ #[cfg(target_os = "windows")]
+ #[error("Cannot enumerate the target process's modules")]
+ EnumProcessModulesError,
+ #[error("goblin failed to parse a module")]
+ GoblinError(#[from] goblin::error::Error),
+ #[error("Address was out of bounds")]
+ InvalidAddress,
+ #[error("Could not read from the target process address space")]
+ ReadFromProcessError(#[from] ReadError),
+ #[cfg(target_os = "windows")]
+ #[error("Section was not found")]
+ SectionNotFound,
+}
+
+#[derive(Debug, Error)]
+pub enum ReadError {
+ #[cfg(target_os = "windows")]
+ #[error("ReadProcessMemory failed")]
+ ReadProcessMemoryError,
+}