diff options
author | mconway <michael.c.conway@gmail.com> | 2012-11-12 20:47:58 (GMT) |
---|---|---|
committer | mconway <michael.c.conway@gmail.com> | 2012-11-12 20:47:58 (GMT) |
commit | 3e5323dd06c4e60d81e99c745ce9edaeef9f2683 (patch) | |
tree | d3ea163b30fcdf7aec0eaf60a2da50bda54385b8 | |
parent | 5cc502db41a746409fd891cc80b25f986481c022 (diff) | |
download | QCG-Data-3e5323dd06c4e60d81e99c745ce9edaeef9f2683.zip QCG-Data-3e5323dd06c4e60d81e99c745ce9edaeef9f2683.tar.gz QCG-Data-3e5323dd06c4e60d81e99c745ce9edaeef9f2683.tar.bz2 |
[#1055] -321000 messages on upload need better message
-rw-r--r-- | idrop-web/application.properties | 2 | ||||
-rw-r--r-- | idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy | 6 | ||||
-rw-r--r-- | idrop-web/grails-app/i18n/messages.properties | 2 | ||||
-rw-r--r-- | idrop-web/grails-app/views/error.gsp | 2 | ||||
-rw-r--r-- | idrop-web/release_notes.txt | 6 |
5 files changed, 15 insertions, 3 deletions
diff --git a/idrop-web/application.properties b/idrop-web/application.properties index 00120c7..6f599a3 100644 --- a/idrop-web/application.properties +++ b/idrop-web/application.properties @@ -4,4 +4,4 @@ app.grails.version=2.1.0 app.name=idrop-web app.servlet.version=2.5 app.version=1.0.2 -#plugins.tomcat=2.1.0 +plugins.tomcat=2.1.0 diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy index 8e672e1..4833c35 100644 --- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy +++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy @@ -6,6 +6,7 @@ import grails.converters.* import org.irods.jargon.core.connection.IRODSAccount import org.irods.jargon.core.exception.DataNotFoundException import org.irods.jargon.core.exception.JargonException +import org.irods.jargon.core.exception.NoResourceDefinedException import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO import org.irods.jargon.core.pub.DataTransferOperations import org.irods.jargon.core.pub.IRODSAccessObjectFactory @@ -167,9 +168,12 @@ class FileController { targetFile.setResource(irodsAccount.defaultStorageResource) Stream2StreamAO stream2Stream = irodsAccessObjectFactory.getStream2StreamAO(irodsAccount) stream2Stream.transferStreamToFileUsingIOStreams(fis, targetFile, f.size, 0) + } catch (NoResourceDefinedException nrd) { + log.error("no resource defined exception", nrd) + response.sendError(500, message(code:"message.no.resource")) } catch (Exception e) { log.error("exception in upload transfer", e) - response.sendError(500,e.message) + response.sendError(500, message(code:"message.error.in.upload")) } finally { // stream2Stream will close input and output streams } diff --git a/idrop-web/grails-app/i18n/messages.properties b/idrop-web/grails-app/i18n/messages.properties index e46865e..73780c1 100644 --- a/idrop-web/grails-app/i18n/messages.properties +++ b/idrop-web/grails-app/i18n/messages.properties @@ -152,6 +152,8 @@ error.unable.to.authenticate=Unable to authenticate error.some.error.occurred=An error occurred processing your request, please inform the system administrator message.update.successful=Update successful +message.no.resource=A default resource needs to be selected from the combo box in the upper righ-hand corner. Select a resource and try your upload again +message.error.in.upload=An error occurred in uploading this file. If the problem persists, contact the service administrator # validation errors org.irods.mydrop.controller.AddMetadataCommand.attribute.blank.error.attribute=Attribute must be entered diff --git a/idrop-web/grails-app/views/error.gsp b/idrop-web/grails-app/views/error.gsp index edada71..9d65afe 100644 --- a/idrop-web/grails-app/views/error.gsp +++ b/idrop-web/grails-app/views/error.gsp @@ -1 +1 @@ -<g:message code="error.some.error.occurred" /> +${request.'javax.servlet.error.message'} diff --git a/idrop-web/release_notes.txt b/idrop-web/release_notes.txt index bf6a10d..ad547e6 100644 --- a/idrop-web/release_notes.txt +++ b/idrop-web/release_notes.txt @@ -39,6 +39,12 @@ the secondary exception is muted. *[#1057] callUpdateTags javascript error +*[#1055] -321000 messages on upload need better message +**Added a NoResourceDefinedException to the jargon error hierarchy so that interfaces can give sensible feedback to users when no resource is defined +in an operation and no default rule exists on iRODS. + +[#1055] -321000 messages on upload need better message +**Handle no default resource errors with a user message ==Features== |