aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/error.go')
-rw-r--r--src/runtime/error.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/runtime/error.go b/src/runtime/error.go
index 3e1ec4bc5a..15f6bdf014 100644
--- a/src/runtime/error.go
+++ b/src/runtime/error.go
@@ -50,6 +50,17 @@ func (e errorString) Error() string {
return "runtime error: " + string(e)
}
+// plainError represents a runtime error described a string without
+// the prefix "runtime error: " after invoking errorString.Error().
+// See Issue #14965.
+type plainError string
+
+func (e plainError) RuntimeError() {}
+
+func (e plainError) Error() string {
+ return string(e)
+}
+
type stringer interface {
String() string
}
@@ -82,5 +93,5 @@ func printany(i interface{}) {
// called from generated code
func panicwrap(pkg, typ, meth string) {
- panic("value method " + pkg + "." + typ + "." + meth + " called using nil *" + typ + " pointer")
+ panic(plainError("value method " + pkg + "." + typ + "." + meth + " called using nil *" + typ + " pointer"))
}