-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Improve warnings and error messages to users about sharing #4687
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,7 +160,7 @@ credentialsController.patch( | |
userId: req.user.id, | ||
}); | ||
throw new ResponseHelper.ResponseError( | ||
`Credential with ID "${credentialId}" could not be found to be updated.`, | ||
'Credential not found to be updated. You can only update credentials owned by you', | ||
undefined, | ||
404, | ||
); | ||
|
@@ -218,7 +218,7 @@ credentialsController.delete( | |
userId: req.user.id, | ||
}); | ||
throw new ResponseHelper.ResponseError( | ||
`Credential with ID "${credentialId}" could not be found to be deleted.`, | ||
'Credential not found to be deleted. You can only removed credentials owned by you', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better wording: |
||
undefined, | ||
404, | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ EEWorkflowController.get( | |
|
||
if (!workflow) { | ||
throw new ResponseHelper.ResponseError( | ||
`Workflow with ID "${workflowId}" could not be found.`, | ||
`Workflow with ID "${workflowId}" does not exist`, | ||
undefined, | ||
404, | ||
); | ||
|
@@ -96,7 +96,11 @@ EEWorkflowController.get( | |
const userSharing = workflow.shared?.find((shared) => shared.user.id === req.user.id); | ||
|
||
if (!userSharing && req.user.globalRole.name !== 'owner') { | ||
throw new ResponseHelper.ResponseError(`Forbidden.`, undefined, 403); | ||
throw new ResponseHelper.ResponseError( | ||
'It looks like you cannot access this workflow. Ask the owner to share it with you.', | ||
undefined, | ||
403, | ||
); | ||
} | ||
|
||
return EEWorkflows.addCredentialsToWorkflow( | ||
|
@@ -140,7 +144,7 @@ EEWorkflowController.post( | |
EEWorkflows.validateCredentialPermissionsToUser(newWorkflow, allCredentials); | ||
} catch (error) { | ||
throw new ResponseHelper.ResponseError( | ||
'The workflow contains credentials that you do not have access to', | ||
'The workflow you trying to save contains credentials not shared with you', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better wording: |
||
undefined, | ||
400, | ||
); | ||
|
@@ -169,7 +173,9 @@ EEWorkflowController.post( | |
|
||
if (!savedWorkflow) { | ||
LoggerProxy.error('Failed to create workflow', { userId: req.user.id }); | ||
throw new ResponseHelper.ResponseError('Failed to save workflow'); | ||
throw new ResponseHelper.ResponseError( | ||
'An error occurred while saving your workflow. Please try again.', | ||
); | ||
} | ||
|
||
if (tagIds && !config.getEnv('workflowTagsDisabled') && savedWorkflow.tags) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better wording:
Credential to be updated not found