diff --git a/NodeApp/src/managers/DojoBackendManager.ts b/NodeApp/src/managers/DojoBackendManager.ts index d3711009cf433867a339eb495161397d895a0fd4..b8e8a41ec1beb1172244b281c61d658dc2c923ec 100644 --- a/NodeApp/src/managers/DojoBackendManager.ts +++ b/NodeApp/src/managers/DojoBackendManager.ts @@ -142,8 +142,12 @@ class DojoBackendManager { if ( verbose ) { if ( error instanceof AxiosError ) { if ( error.response ) { - if ( error.response.status === StatusCodes.CONFLICT ) { - spinner.fail(`You've already reached the max number of exercise of this assignment.`); + if ( error.response.status === StatusCodes.INSUFFICIENT_SPACE_ON_RESOURCE ) { + if ( error.response.data && (error.response.data as DojoBackendResponse<Array<GitlabUser>>).code === DojoStatusCode.MAX_EXERCISE_PER_ASSIGNMENT_REACHED ) { + spinner.fail(`The following users have reached the maximum number of exercise of this assignment : ${ ((error.response.data as DojoBackendResponse<Array<GitlabUser>>).data as Array<GitlabUser>).map(user => user.name).join(', ') }.`); + } else { + spinner.fail(`You've already reached the max number of exercise of this assignment.`); + } } else { if ( (error.response.data as DojoBackendResponse<unknown>).code === DojoStatusCode.EXERCISE_CREATION_GITLAB_ERROR ) { spinner.fail(`Exercise creation error: An unknown error occurred while creating the exercise on Gitlab. Please try again later or contact an administrator.`);