Skip to content

Commit 719f6e1

Browse files
committed
clean up error handling a bit.
1 parent 0f4b068 commit 719f6e1

2 files changed

Lines changed: 1 addition & 34 deletions

File tree

src/Angular.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ var consoleNode,
3030
angularCallbacks = extensionMap(angular, 'callbacks'),
3131
nodeName;
3232

33-
function angularAlert(){
34-
log(arguments); window.alert.apply(window, arguments);
35-
}
36-
3733
function foreach(obj, iterator, context) {
3834
var key;
3935
if (obj) {
@@ -178,21 +174,6 @@ function indexOf(array, obj) {
178174
return -1;
179175
}
180176

181-
function log(a, b, c){
182-
var console = window['console'];
183-
switch(arguments.length) {
184-
case 1:
185-
console['log'](a);
186-
break;
187-
case 2:
188-
console['log'](a, b);
189-
break;
190-
default:
191-
console['log'](a, b, c);
192-
break;
193-
}
194-
}
195-
196177
function error(a, b, c){
197178
var console = window['console'];
198179
switch(arguments.length) {
@@ -208,20 +189,6 @@ function error(a, b, c){
208189
}
209190
}
210191

211-
function consoleLog(level, objs) {
212-
var log = document.createElement("div");
213-
log.className = level;
214-
var msg = "";
215-
var sep = "";
216-
for ( var i = 0; i < objs.length; i++) {
217-
var obj = objs[i];
218-
msg += sep + (typeof obj == 'string' ? obj : toJson(obj));
219-
sep = " ";
220-
}
221-
log.appendChild(document.createTextNode(msg));
222-
consoleNode.appendChild(log);
223-
}
224-
225192
function isLeafNode (node) {
226193
if (node) {
227194
switch (node.nodeName) {

src/Scope.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function createScope(parent, services, existing) {
147147
try {
148148
return expressionCompile(expression).apply(instance, slice.call(arguments, 2, arguments.length));
149149
} catch (e) {
150-
error(e);
150+
(instance.$log || {error:error}).error(e);
151151
if (isFunction(exceptionHandler)) {
152152
exceptionHandler(e);
153153
} else if (exceptionHandler) {

0 commit comments

Comments
 (0)