fixes for product-iots #504

merge-requests/1/head
Nirothipan 7 years ago
parent 721b059de7
commit 9d3b2ebf42

@ -562,7 +562,12 @@ public class UserManagementServiceImpl implements UserManagementService {
} }
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
String msg = "Error occurred while inviting user to enrol their device"; String msg = "Error occurred while inviting user to enrol their device";
if (e.getMessage() != null) {
msg = e.getMessage();
}
log.error(msg, e); log.error(msg, e);
return Response.serverError().entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
} catch (UserStoreException e) { } catch (UserStoreException e) {
String msg = "Error occurred while getting claim values to invite user"; String msg = "Error occurred while getting claim values to invite user";
log.error(msg, e); log.error(msg, e);

@ -629,7 +629,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
metaInfo.getRecipients()).build(); metaInfo.getRecipients()).build();
DeviceManagementDataHolder.getInstance().getEmailSenderService().sendEmail(ctx); DeviceManagementDataHolder.getInstance().getEmailSenderService().sendEmail(ctx);
} catch (EmailSendingFailedException ex) { } catch (EmailSendingFailedException ex) {
throw new DeviceManagementException("Error occurred while sending enrollment invitation", ex); throw new DeviceManagementException("Error occurred while sending enrollment invitation." + ex.getMessage(), ex);
} }
} }

@ -89,10 +89,11 @@ $("a#invite-user-link").click(function () {
modalDialog.hide(); modalDialog.hide();
}); });
}, },
function () { function (data) {
var msg = JSON.parse(data.responseText);
modalDialog.header('<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw ' + modalDialog.header('<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw ' +
'fw-error fw-stack-1x"></i> </span> Unexpected Error !'); 'fw-error fw-stack-1x"></i> </span> Unexpected Error !');
modalDialog.content('An unexpected error occurred. Try again later.'); modalDialog.content(msg.message);
modalDialog.footer('<div class="buttons"><a href="#" id="invite-user-error-link" ' + modalDialog.footer('<div class="buttons"><a href="#" id="invite-user-error-link" ' +
'class="btn-operations">Ok </a></div>'); 'class="btn-operations">Ok </a></div>');
$("a#invite-user-error-link").click(function () { $("a#invite-user-error-link").click(function () {

@ -65,8 +65,13 @@ public class EmailSenderServiceImpl implements EmailSenderService {
for (String recipient : emailCtx.getRecipients()) { for (String recipient : emailCtx.getRecipients()) {
ContentProviderInfo info = emailCtx.getContentProviderInfo(); ContentProviderInfo info = emailCtx.getContentProviderInfo();
EmailData emailData; EmailData emailData;
String transportSenderName = "mailto";
try { try {
emailData = contentProvider.getContent(info.getTemplate(), info.getParams()); emailData = contentProvider.getContent(info.getTemplate(), info.getParams());
if(EmailSenderDataHolder.getInstance().getConfigurationContextService()
.getServerConfigContext().getAxisConfiguration().getTransportOut(transportSenderName) == null){
throw new EmailSendingFailedException("Email transport is not configured.");
}
} catch (ContentProcessingInterruptedException e) { } catch (ContentProcessingInterruptedException e) {
throw new EmailSendingFailedException("Error occurred while retrieving email content to be " + throw new EmailSendingFailedException("Error occurred while retrieving email content to be " +
"sent for recipient '" + recipient + "'", e); "sent for recipient '" + recipient + "'", e);

Loading…
Cancel
Save