1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-20 22:45:24 +00:00

output all inner error messages

This commit is contained in:
Darien Raymond 2017-02-24 01:05:02 +01:00
parent 9cbc9b7170
commit 702cfd69de
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 6 additions and 1 deletions

View File

@ -25,7 +25,11 @@ type Error struct {
// Error implements error.Error().
func (v Error) Error() string {
return v.message
msg := v.message
if v.inner != nil {
msg += " > " + v.inner.Error()
}
return msg
}
// Inner implements hasInnerError.Inner()

View File

@ -23,4 +23,5 @@ func TestActionRequired(t *testing.T) {
err = Base(io.EOF).RequireUserAction().Message("TestError4")
err = Base(err).Message("TestError5")
assert.Bool(IsActionRequired(err)).IsTrue()
assert.String(err.Error()).Contains("EOF")
}