From 836cccf887fadb02f139631cce2b8781ffe85948 Mon Sep 17 00:00:00 2001 From: "marko.tikvic" Date: Mon, 15 Apr 2019 15:35:23 +0200 Subject: [PATCH] WrapErrLoc() func --- error_util.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 error_util.go diff --git a/error_util.go b/error_util.go new file mode 100644 index 0000000..a5a307a --- /dev/null +++ b/error_util.go @@ -0,0 +1,12 @@ +package webutility + +import ( + "fmt" + + "git.to-net.rs/marko.tikvic/gologger" +) + +func WrapErrLoc(e error) error { + file, line := gologger.CallerFilenameAndLineNumber() + return fmt.Errorf("%s %d: %s", file, line, e.Error()) +} -- 1.8.1.2