Ohif 168 proper error handling (#111)

* Adding a better error handling for DICOMWeb getJson method

* Adding a better error handling for DICOMWeb getBulkData method

* Fixinf some typos. Using console.error to log errors

* Better error handling for DIMSE connections

* Using meteor error in StudyListSearch to better display same error in the client

* Using Meteor.Error for a better pattern. Added an error message in the study list. created connection error types to DICOMWeb connection errors

* Changing error types for server connection. Added better errors for DIMSE server on sockets

* Improving viewer response to error being throw when not finding server to display studies

* OHIF-168: adding catches clauses for retrieveStudyMetada method

* OHIF-168: fixing typo in DIMSE.js

* OHIF-168: setting the session variable  to false when starting a new studylist search

* OHIF-168: Using OHIF.log instead of console

* OHIF-168: removing parsing into string for OHIF.log in Connection.js

* OHIF-168: improving error message visibility in study viewer
This commit is contained in:
André Botelho Almeida authored and Erik Ziegler committed 2017-09-19 17:44:39 +02:00
1 parent 4c5dcfeab0
commit af4b8b45f5
18 files changed
+285 -88

No files matched your search

@@ -80,9 +80,13 @@
{{#if session "showLoadingText"}}
{{>loadingText}}
{{else}}
{{#unless numberOfStudies}}
<div class="notFound">No matching results</div>
{{/unless}}
{{#if session "serverError"}}
<div class="notFound">There was an error fetching studies</div>
{{else}}
{{#unless numberOfStudies}}
<div class="notFound">No matching results</div>
{{/unless}}
{{/if}}
{{/if}}
</div>
</template>
@@ -7,6 +7,7 @@ import { moment } from 'meteor/momentjs:moment';
import { OHIF } from 'meteor/ohif:core';
Session.setDefault('showLoadingText', true);
Session.setDefault('serverError', false);
Template.studylistResult.helpers({
/**
@@ -132,6 +133,9 @@ function search() {
// Show loading message
Session.set('showLoadingText', true);
// Hiding error message
Session.set('serverError', false);
// Create the filters to be used for the StudyList Search
filter = {
patientName: getFilter($('input#patientName').val()),
@@ -152,14 +156,27 @@ function search() {
Meteor.call('StudyListSearch', filter, (error, studies) => {
OHIF.log.info('StudyListSearch');
// Hide loading text
Session.set('showLoadingText', false);
if (error) {
OHIF.log.warn(error);
Session.set('serverError', true);
const errorType = error.error;
if (errorType === 'server-connection-error') {
OHIF.log.error('There was an error connecting to the DICOM server, please verify if it is up and running.');
} else if (errorType === 'server-internal-error') {
OHIF.log.error('There was an internal error with the DICOM server');
} else {
OHIF.log.error('For some reason we could not list the studies.')
}
OHIF.log.error(error.stack);
return;
}
// Hide loading text
Session.set('showLoadingText', false);
if (!studies) {
OHIF.log.warn('No studies found');
return;