bind: fix error type

Errors was recently converted to use objects as representation instead
of strings. Issue golang/go#17073 exposed a few places that wasn't properly
updated. Fix them and add the test case from the the issue.

Fixes golang/go#17073

Change-Id: I0191993a8427d930540716407fc09032f282fc66
Reviewed-on: https://go-review.googlesource.com/29176
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Elias Naur
2016-09-16 13:52:19 +00:00
parent e99a906c3a
commit 61011ba584
7 changed files with 27 additions and 11 deletions
+3 -3
View File
@@ -418,9 +418,9 @@ public class SeqTest extends InstrumentationTestCase {
public void testErrorField() {
final String want = "an error message";
Node n = Testpkg.newNode("ErrTest");
n.setErr(want);
String got = n.getErr();
assertEquals("want back the error message we set", want, got);
n.setErr(new Exception(want));
Exception got = n.getErr();
assertEquals("want back the error message we set", want, got.getMessage());
}
//test if we have JNI local reference table overflow error