Skip to content

Commit

Permalink
throw an applicaton error if the user has no personal project
Browse files Browse the repository at this point in the history
that way it get's reported to sentry
  • Loading branch information
despairblue committed Feb 20, 2024
1 parent 2a6da18 commit ec8591d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/src/workflows/workflows.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { WorkflowSharingService } from './workflowSharing.service';
import { UserManagementMailer } from '@/UserManagement/email';
import { ProjectRepository } from '@/databases/repositories/project.repository';
import { ProjectService } from '@/services/project.service';
import { ApplicationError } from '../../../workflow/src';

@Authorized()
@RestController('/workflows')
Expand Down Expand Up @@ -138,7 +139,7 @@ export class WorkflowsController {

// Safe guard in case the personal project does not exist for whatever reason.
if (project === null) {
throw new InternalServerError('Failed to save workflow');
throw new ApplicationError('No personal project found');
}

const newSharedWorkflow = this.sharedWorkflowRepository.create({
Expand Down

0 comments on commit ec8591d

Please sign in to comment.