Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
sidecar
Commits
af667df6
Commit
af667df6
authored
Oct 21, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add traceError error
parent
81722a5e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
error.go
tool/error.go
+14
-0
No files found.
tool/error.go
View file @
af667df6
package
tool
import
(
"fmt"
"runtime"
"github.com/juju/errors"
)
var
Annotate
=
errors
.
Annotate
func
TraceError
(
err
error
,
skip
int
)
error
{
if
err
==
nil
{
return
nil
}
_
,
file
,
line
,
ok
:=
runtime
.
Caller
(
skip
+
1
)
if
!
ok
{
return
err
}
return
fmt
.
Errorf
(
"%s:%d: %s"
,
file
,
line
,
err
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment