Commit 5f319762 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 7f72b67b
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
// error type which is raised by raise(arg) // error type which is raised by raise(arg)
type Error struct { type Error struct {
arg interface{} arg interface{}
link *Error link *Error // chain of linked Error(s) - see erraddcontext()
} }
func (e *Error) Error() string { func (e *Error) Error() string {
...@@ -81,7 +81,7 @@ func errcatch(f func (e *Error)) { ...@@ -81,7 +81,7 @@ func errcatch(f func (e *Error)) {
f(e) f(e)
} }
// hook into unwidnign process with f() call. Returned error is reraised. // hook into unwinding process with f() call. Returned error is reraised.
// see also: erraddcontext() // see also: erraddcontext()
// must be called under defer // must be called under defer
func erronunwind(f func(e *Error) *Error) { func erronunwind(f func(e *Error) *Error) {
...@@ -104,7 +104,7 @@ func errlinkerror(e *Error, arg interface{}) *Error { ...@@ -104,7 +104,7 @@ func errlinkerror(e *Error, arg interface{}) *Error {
*/ */
// f is called if error unwining is happenning. // f is called if error unwinding is happening.
// call result is added to raised error as "prefix" context // call result is added to raised error as "prefix" context
func erraddcontext(f func() interface{}) { func erraddcontext(f func() interface{}) {
e := _errcatch(recover()) e := _errcatch(recover())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment