aboutsummaryrefslogtreecommitdiffhomepage
path: root/system/output.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-17 02:31:46 +0900
committerOphestra <cat@gensokyo.uk>2025-03-17 02:44:07 +0900
commit9a1f8e129fe0f9919981b8a1d345a9b455bd76de (patch)
treee52f33a3908c256aebb30f059cabd40f371a886f /system/output.go
parentee108603572101ad3c285830e04ee248916b6c5d (diff)
sandbox: wrap fmsg interface
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/output.go')
-rw-r--r--system/output.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/system/output.go b/system/output.go
new file mode 100644
index 00000000..daf43864
--- /dev/null
+++ b/system/output.go
@@ -0,0 +1,20 @@
+package system
+
+import "git.gensokyo.uk/security/fortify/internal/sandbox"
+
+var msg sandbox.Msg = new(sandbox.DefaultMsg)
+
+func SetOutput(v sandbox.Msg) {
+ if v == nil {
+ msg = new(sandbox.DefaultMsg)
+ } else {
+ msg = v
+ }
+}
+
+func wrapErrSuffix(err error, a ...any) error {
+ if err == nil {
+ return nil
+ }
+ return msg.WrapErr(err, append(a, err)...)
+}