From d804bbcd51ec83bee1f4a3ccd42c3bd7eb38a988 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Thu, 19 Jul 2012 14:07:00 -0700 Subject: feat($interpolate): provide contextual error messages if an exception occurs during interpolation of a string (e.g. name() in "Hello, {{name()}}!" throws an exception) we now print an error message with the expression that was being evaluated when the exception was thrown. --- test/BinderSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/BinderSpec.js') diff --git a/test/BinderSpec.js b/test/BinderSpec.js index 6d5dd91e..ba90539f 100644 --- a/test/BinderSpec.js +++ b/test/BinderSpec.js @@ -175,7 +175,7 @@ describe('Binder', function() { $rootScope.error['throw'] = function() {throw 'MyError';}; errorLogs.length = 0; $rootScope.$apply(); - expect(errorLogs.shift()).toBe('MyError'); + expect(errorLogs.shift().message).toBe('Error while interpolating: {{error.throw()}}\nMyError'); $rootScope.error['throw'] = function() {return 'ok';}; $rootScope.$apply(); -- cgit v1.2.3