Project

General

Profile

« Previous | Next » 

Revision 54848

[Trunk|Library]
Fix error logs in Claims Pages and remaining components (approvedByCommunity, userEmailPreferences, navigationBar).

View differences:

claimsByToken.component.ts
9 9

  
10 10
import{EnvProperties}                from '../../utils/properties/env-properties';
11 11
import {ErrorCodes}                  from '../../utils/properties/errorCodes';
12
import {ErrorMessagesComponent}      from '../../utils/errorMessages.component';
12 13

  
13 14
import {ClaimsDatatablePipe}         from '../../utils/pipes/claimsDatatable.pipe';
14 15

  
......
51 52
  public contact_person: string[] = ["Konstantina", "Argiro", "Katerina"];
52 53

  
53 54
  private errorCodes: ErrorCodes;
55
  private errorMessages: ErrorMessagesComponent;
54 56
  public pending_status: number;
55 57
  public curated_status: number;
56 58

  
......
90 92
               private claimsByTokenService: ClaimsByTokenService,
91 93
               private _meta: Meta, private _title: Title) {
92 94
      this.errorCodes = new ErrorCodes();
95
      this.errorMessages = new ErrorMessagesComponent();
93 96
      this.pending_status = this.errorCodes.LOADING;
94 97
      this.curated_status = this.errorCodes.LOADING;
95 98
  }
......
319 322
                this.curated_status = this.errorCodes.DONE;
320 323
            },
321 324
            err => {
322
              if(err.status == '404') {
325
              this.handleError("Error getting claims for openaire id: "+this.openaireId, err);
326
              this.pending_status = this.errorMessages.getErrorCode(err.status);
327
              this.curated_status = this.pending_status;
328

  
329
              /*if(err.status == '404') {
323 330
                this.pending_status = this.errorCodes.NOT_FOUND;
324 331
                this.curated_status = this.errorCodes.NOT_FOUND;
325 332
              } else if(err.status == '500') {
......
328 335
              } else {
329 336
                this.pending_status = this.errorCodes.NOT_AVAILABLE;
330 337
                this.curated_status = this.errorCodes.NOT_AVAILABLE;
331
              }
338
              }*/
332 339
              this.showTables = true;
333 340

  
334 341
              if(!this.triggered) {
......
344 351
              }
345 352

  
346 353
              this.accessStatus = "invalid";
347
              console.log(err);
354
              //console.log(err);
348 355
            }
349 356
          );
350 357
      } else {
......
471 478
              this.validateJWTandToken();
472 479
            },
473 480
            err => {
474
              console.log(err);
481
              //console.log(err);
482
              this.handleError("Error updating claim curation: "+JSON.stringify(claimCurationInfo), err);
475 483
              this.curated_status = this.errorCodes.NOT_SAVED;
476 484
            }
477 485
          );
......
495 503
          },
496 504
          err => {
497 505
            //this.closeLoading();
498
            console.log(err);
506
            //console.log(err);
507
            this.handleError("Error updating claims: right: "+JSON.stringify(this.selectedRight_PendingMode)+" and wrong: "+JSON.stringify(this.selectedWrong_PendingMode), err);
499 508
            this.pending_status = this.errorCodes.NOT_SAVED;
500 509
          }
501 510
        );
......
562 571

  
563 572
  }
564 573

  
574
  private handleError(message: string, error) {
575
      console.error("Claims Project Manager Page: "+message, error);
576
  }
565 577
}

Also available in: Unified diff