mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
clean up error handling a bit.
This commit is contained in:
parent
0f4b068bd6
commit
719f6e15a0
2 changed files with 1 additions and 34 deletions
|
|
@ -30,10 +30,6 @@ var consoleNode,
|
|||
angularCallbacks = extensionMap(angular, 'callbacks'),
|
||||
nodeName;
|
||||
|
||||
function angularAlert(){
|
||||
log(arguments); window.alert.apply(window, arguments);
|
||||
}
|
||||
|
||||
function foreach(obj, iterator, context) {
|
||||
var key;
|
||||
if (obj) {
|
||||
|
|
@ -178,21 +174,6 @@ function indexOf(array, obj) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
function log(a, b, c){
|
||||
var console = window['console'];
|
||||
switch(arguments.length) {
|
||||
case 1:
|
||||
console['log'](a);
|
||||
break;
|
||||
case 2:
|
||||
console['log'](a, b);
|
||||
break;
|
||||
default:
|
||||
console['log'](a, b, c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function error(a, b, c){
|
||||
var console = window['console'];
|
||||
switch(arguments.length) {
|
||||
|
|
@ -208,20 +189,6 @@ function error(a, b, c){
|
|||
}
|
||||
}
|
||||
|
||||
function consoleLog(level, objs) {
|
||||
var log = document.createElement("div");
|
||||
log.className = level;
|
||||
var msg = "";
|
||||
var sep = "";
|
||||
for ( var i = 0; i < objs.length; i++) {
|
||||
var obj = objs[i];
|
||||
msg += sep + (typeof obj == 'string' ? obj : toJson(obj));
|
||||
sep = " ";
|
||||
}
|
||||
log.appendChild(document.createTextNode(msg));
|
||||
consoleNode.appendChild(log);
|
||||
}
|
||||
|
||||
function isLeafNode (node) {
|
||||
if (node) {
|
||||
switch (node.nodeName) {
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ function createScope(parent, services, existing) {
|
|||
try {
|
||||
return expressionCompile(expression).apply(instance, slice.call(arguments, 2, arguments.length));
|
||||
} catch (e) {
|
||||
error(e);
|
||||
(instance.$log || {error:error}).error(e);
|
||||
if (isFunction(exceptionHandler)) {
|
||||
exceptionHandler(e);
|
||||
} else if (exceptionHandler) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue