Project

General

Profile

« Previous | Next » 

Revision 5382

Added by berkley almost 14 years ago

added better debugging error messages for CN dev errors

View differences:

src/edu/ucsb/nceas/metacat/dataone/CrudService.java
564 564
                                sessionData.getUserName(), 
565 565
                                sessionData.getGroupNames(), true, params);
566 566
                    } catch (PropertyNotFoundException e) {
567
                        throw new ServiceFailure("1030", e.getMessage());
567
                        e.printStackTrace();
568
                        throw new ServiceFailure("1030", "Error getting property from metacat: " + e.getMessage());
568 569
                    } catch (ClassNotFoundException e) {
569
                        throw new ServiceFailure("1030", e.getMessage());
570
                        e.printStackTrace();
571
                        throw new ServiceFailure("1030", "Class not found error when reading from metacat: " + e.getMessage());
570 572
                    } catch (IOException e) {
571
                        throw new ServiceFailure("1030", e.getMessage());
573
                        e.printStackTrace();
574
                        throw new ServiceFailure("1030", "IOException while reading from metacat: " + e.getMessage());
572 575
                    } catch (SQLException e) {
573
                        throw new ServiceFailure("1030", e.getMessage());
576
                        e.printStackTrace();
577
                        throw new ServiceFailure("1030", "SQLException while reading from metacat: " + e.getMessage());
574 578
                    } catch (McdbException e) {
575
                        throw new ServiceFailure("1030", e.getMessage());
579
                        e.printStackTrace();
580
                        throw new ServiceFailure("1030", "Metacat DB exception while reading from metacat: " + e.getMessage());
576 581
                    } catch (ParseLSIDException e) {
577
                        throw new NotFound("1020", e.getMessage());
582
                        e.printStackTrace();
583
                        throw new NotFound("1020", "LSID parsing exception while reading from metacat: " + e.getMessage());
578 584
                    } catch (InsufficientKarmaException e) {
579
                        throw new NotAuthorized("1000", "Not authorized for get().");
585
                        e.printStackTrace();
586
                        throw new NotAuthorized("1000", "User not authorized for get(): " + e.getMessage());
580 587
                    }
581 588

  
582 589
                    return "Completed";
......
647 654
                                sessionData.getUserName(), 
648 655
                                sessionData.getGroupNames(), true, params);
649 656
                    } catch (PropertyNotFoundException e) {
650
                        throw new ServiceFailure("1030", e.getMessage());
657
                        e.printStackTrace();
658
                        throw new ServiceFailure("1030", "Property not found while reading system metadata from metacat: " + e.getMessage());
651 659
                    } catch (ClassNotFoundException e) {
652
                        throw new ServiceFailure("1030", e.getMessage());
660
                        e.printStackTrace();
661
                        throw new ServiceFailure("1030", "Class not found while reading system metadata from metacat: " + e.getMessage());
653 662
                    } catch (IOException e) {
654
                        throw new ServiceFailure("1030", e.getMessage());
663
                        e.printStackTrace();
664
                        throw new ServiceFailure("1030", "IOException while reading system metadata from metacat: " + e.getMessage());
655 665
                    } catch (SQLException e) {
656
                        throw new ServiceFailure("1030", e.getMessage());
666
                        e.printStackTrace();
667
                        throw new ServiceFailure("1030", "SQLException while reading system metadata from metacat: " + e.getMessage());
657 668
                    } catch (McdbException e) {
658
                        throw new ServiceFailure("1030", e.getMessage());
669
                        e.printStackTrace();
670
                        throw new ServiceFailure("1030", "Metacat DB Exception while reading system metadata from metacat: " + e.getMessage());
659 671
                    } catch (ParseLSIDException e) {
660
                        throw new NotFound("1020", e.getMessage());
672
                        e.printStackTrace();
673
                        throw new NotFound("1020", "Error parsing LSID while reading system metadata from metacat: " + e.getMessage());
661 674
                    } catch (InsufficientKarmaException e) {
662
                        throw new NotAuthorized("1000", "Not authorized for get().");
675
                        e.printStackTrace();
676
                        throw new NotAuthorized("1000", "User not authorized for get() on system metadata: " + e.getMessage());
663 677
                    }
664 678

  
665 679
                    return "Completed";
......
1071 1085
            sysmetaOut = new ByteArrayOutputStream();
1072 1086
            mctx.marshalDocument(sysmeta, "UTF-8", null, sysmetaOut);
1073 1087
        } catch (JiBXException e) {
1088
            e.printStackTrace();
1074 1089
            throw new ServiceFailure("1190", "Failed to serialize and insert SystemMetadata: " + e.getMessage());
1075 1090
        }
1076 1091
        
......
1091 1106
            SystemMetadata sysmeta = (SystemMetadata) uctx.unmarshalDocument(xml, null);
1092 1107
            return sysmeta;
1093 1108
        } catch (JiBXException e) {
1094
            throw new ServiceFailure("1190", "Failed to serialize and insert SystemMetadata: " + e.getMessage());
1109
            e.printStackTrace();
1110
            throw new ServiceFailure("1190", "Failed to deserialize and insert SystemMetadata: " + e.getMessage());
1095 1111
        }    
1096 1112
    }
1097 1113
    

Also available in: Unified diff