Revision 9040e9fe ui/static/synnefo.js

b/ui/static/synnefo.js
54 54
            try {
55 55
                ajax_error(jqXHR.status, undefined, 'Unknown', jqXHR.responseText);
56 56
            } catch(err) {
57
                ajax_error(0, undefined, 'Unknown', jqXHR.responseText);
57
                ajax_error(-5, "UI Error", 'Unknown', err);
58 58
            }
59 59
        }
60 60

  
......
335 335
            try {
336 336
                ajax_error(jqXHR.status, undefined, 'Update VMs', jqXHR.responseText);
337 337
            } catch(err) {
338
                ajax_error(0, undefined, 'Update VMs', jqXHR.responseText);
338
                ajax_error(-5, "UI Error", 'Update VMs', err);
339 339
            }
340 340
            return false;
341 341
            },
......
356 356
                    //servers = data.servers.values;
357 357
                    update_servers_data(data.servers.values, data);
358 358
                    update_machines_view(data);
359
                } catch(err) { ajax_error('400', undefined, 'Update VMs', jqXHR.responseText);}
359
                } catch(err) { ajax_error(-5, "UI Error", 'Update VMs', err);}
360 360
            } else if (jqXHR.status != 304){
361 361
                try { console.info('update_vms callback:' + jqXHR.status ) } catch(err) {}
362 362
                /*
......
481 481
            try {
482 482
                ajax_error(jqXHR.status, undefined, 'Update networks', jqXHR.responseText);
483 483
            } catch(err) {
484
                ajax_error(0, undefined, 'Update networks', jqXHR.responseText);
484
                ajax_error(-5, "UI Error", 'Update networks', err);
485 485
            }
486 486
            return false;
487 487
            },
......
503 503
                    update_servers_data(data.servers.values, data);
504 504
                    jQuery.parseJSON(data);
505 505
                    update_network_names(data);
506
                } catch(err) { ajax_error('400', undefined, 'Update networks', jqXHR.responseText);}
506
                } catch(err) { ajax_error(-5, "UI Error", 'Update networks', err);}
507 507
            } else if (jqXHR.status == 304) {
508 508
                update_network_names();
509 509
            }
......
546 546
            try {
547 547
                ajax_error(jqXHR.status, undefined, 'Update network names', jqXHR.responseText);
548 548
            } catch(err) {
549
                ajax_error(0, undefined, 'Update network names', jqXHR.responseText);
549
                ajax_error(-5, "UI Error", 'Update network names', err);
550 550
            }
551 551
            return false;
552 552
            },
......
563 563
                    jQuery.parseJSON(data);
564 564
                    update_networks_view(servers_data, data);
565 565
                } catch(err) {
566
                    ajax_error('400', undefined, 'Update network names', jqXHR.responseText);
566
                    ajax_error(-5, "UI Error", 'Update network names', err);
567 567
                }
568 568
            } else if (jqXHR.status == 304) {
569 569
                update_networks_view(servers_data);
......
595 595
                    try {
596 596
                        ajax_error(jqXHR.status, undefined, 'Update Images', jqXHR.responseText);
597 597
                    } catch(err) {
598
                        ajax_error(0, undefined, 'Update Images', jqXHR.responseText);
598
                        ajax_error(-5, "UI error", 'Update Images', err);
599 599
                    }
600 600
                },
601 601
        success: function(data, textStatus, jqXHR) {
......
721 721
            try {
722 722
                ajax_error(jqXHR.status, undefined, 'Update Flavors', jqXHR.responseText);
723 723
            } catch (err) {
724
                ajax_error(err);
724
                ajax_error(-5, "UI Error", "Update Flavors", err);
725 725
            }
726 726
            // start updating vm list
727 727
            update_vms(UPDATE_INTERVAL);
......
871 871
                    try {
872 872
                        ajax_error(jqXHR.status, undefined, 'Create VM', jqXHR.responseText);
873 873
                    } catch(err) {
874
                        ajax_error(0, undefined, 'Create VM', jqXHR.responseText);
874
                        ajax_error(-5, "UI Error", 'Create VM', err);
875 875
                    }
876 876
           },
877 877
    success: function(data, textStatus, jqXHR) {
......
1292 1292
                $("a#metadata-scrollable").data('overlay').close();
1293 1293
                ajax_error(jqXHR.status, undefined, 'Get metadata', jqXHR.responseText);
1294 1294
            } catch (err) {
1295
                ajax_error(err);
1295
                ajax_error(-5, "UI Error", "Get metadata", err);
1296 1296
            }
1297 1297
        },
1298 1298
        success: function(data, textStatus, jqXHR) {
......
1324 1324
                $("a#metadata-scrollable").data('overlay').close();
1325 1325
                ajax_error(jqXHR.status, undefined, 'Delete metadata', jqXHR.responseText);
1326 1326
            } catch (err) {
1327
                ajax_error(err);
1327
                ajax_error(-5, "UI Error", "Delete metadata", err);
1328 1328
            }
1329 1329
        },
1330 1330
        success: function(data, textStatus, jqXHR) {
......
1355 1355
                $("a#metadata-scrollable").data('overlay').close();
1356 1356
                ajax_error(jqXHR.status, undefined, 'add metadata', jqXHR.responseText);
1357 1357
            } catch (err) {
1358
                ajax_error(err);
1358
                ajax_error(-5, "UI Error", "add metadata", err);
1359 1359
            }
1360 1360
        },
1361 1361
        success: function(data, textStatus, jqXHR) {
......
1427 1427
                $("a#networkscreate").overlay().close();
1428 1428
                ajax_error(jqXHR.status, undefined, 'Create network', jqXHR.responseText);
1429 1429
            } catch (err) {
1430
                ajax_error(err);
1430
                ajax_error(-5, "UI Error", "Create network", err);
1431 1431
            }
1432 1432
        },
1433 1433
        success: function(data, textStatus, jqXHR) {
......
1473 1473
            try {
1474 1474
                ajax_error(jqXHR.status, undefined, 'Rename network', jqXHR.responseText);
1475 1475
            } catch (err) {
1476
                ajax_error(0, undefined, 'Rename network', jqXHR.responseText);
1476
                ajax_error(-1, "UI Error", 'Rename network', err);
1477 1477
            }
1478 1478
        },
1479 1479
        success: function(data, textStatus, jqXHR) {
......
1560 1560
                $("a#add-machines-overlay").data('overlay').close();
1561 1561
                ajax_error(jqXHR.status, undefined, 'Add server to network', jqXHR.responseText);
1562 1562
            } catch (err) {
1563
                ajax_error(0, undefined, 'Add server to network', jqXHR.responseText);
1563
                ajax_error(-5, "UI Error", 'Add server to network', err);
1564 1564
            }
1565 1565
        },
1566 1566
        success: function(data, textStatus, jqXHR) {
......
1608 1608
            try {
1609 1609
                ajax_error(jqXHR.status, undefined, 'Remove server form network', jqXHR.responseText);
1610 1610
            } catch (err) {
1611
                ajax_error(0, undefined, 'Remove server form network', jqXHR.responseText);
1611
                ajax_error(-5, "UI Error", 'Remove server form network', err);
1612 1612
            }
1613 1613
        },
1614 1614
        success: function(data, textStatus, jqXHR) {
......
1648 1648
            try {
1649 1649
                ajax_error(jqXHR.status, undefined, 'Set firewall profile', jqXHR.responseText);
1650 1650
            } catch (err) {
1651
                ajax_error(0, undefined, 'Set firewall profile', jqXHR.responseText);
1651
                ajax_error(-5, "UI Error", 'Set firewall profile', err);
1652 1652
            }
1653 1653
        },
1654 1654
        success: function(data, textStatus, jqXHR) {

Also available in: Unified diff