[
https://issues.apache.org/jira/browse/USERGRID-1189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15075582#comment-15075582
]
ASF GitHub Bot commented on USERGRID-1189:
------------------------------------------
Github user GERey commented on a diff in the pull request:
https://github.com/apache/usergrid/pull/453#discussion_r48642476
--- Diff:
stack/rest/src/main/java/org/apache/usergrid/rest/management/users/organizations/OrganizationsResource.java
---
@@ -113,8 +113,8 @@ public ApiResponse newOrganizationForUserFromForm(
@Context UriInfo ui, Map<Stri
ApiResponse response = createApiResponse();
response.setAction( "new organization for user" );
- if ( organizationName == null ) {
- throw new ManagementException( "Could not find organization
for name: " + organizationName );
+ if ( organizationName == null || organizationName.isEmpty() ) {
+ throw new ManagementException( "Organization not specified." );
--- End diff --
I would think we'd want to still throw back the name of the organization we
haven't found in order to search through logs better? Is there a reason we
wouldn't want to do that?
> Fix confusing error message(s)
> ------------------------------
>
> Key: USERGRID-1189
> URL: https://issues.apache.org/jira/browse/USERGRID-1189
> Project: Usergrid
> Issue Type: Story
> Affects Versions: 2.1.1
> Reporter: Mike Dunker
>
> This is just to pick off any low-hanging fruit re error messages.
> Example:
> curl -H "Authorization:Bearer $UGTOKEN" -X POST
> "http://localhost:8080/management/users/[email protected]"
> {"error":"management","timestamp":1451521189319,"duration":0,"error_description":"Could
> not find organization for email :
> [email protected]","exception":"org.apache.usergrid.management.exceptions.ManagementException"}
> Error message should be "Could not find user for email..."
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)