refactor: enhance error handling in technical career creation to mana…#168
Open
refactor: enhance error handling in technical career creation to mana…#168
Conversation
…ge server response inconsistencies
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| return error.response.data?.id || ''; | ||
| } | ||
| throw error; | ||
| } |
There was a problem hiding this comment.
Bug: Success Status Blocks Error Handling
The catch block checks for error.response?.status === 201, but HTTP 201 is a success status code in the 2xx range. Axios treats 2xx responses as successful and never throws errors for them, so this condition will never be true. The error handling logic intended to manage server response inconsistencies won't work as expected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ge server response inconsistencies
📄: Descripción
Proporciona una breve descripción de los cambios realizados en este PR. Explica el problema que resuelve o la funcionalidad que agrega.
📎: Lista de Verificación
Revisa y marca cada ítem para asegurarte de que el PR esté completo.
✔️: Cómo Probar Este Cambio
Explica los pasos necesarios para probar este cambio, como comandos a ejecutar, archivos de configuración necesarios, etc.
📸: Capturas de Pantalla (Opcional)
Si este PR incluye cambios en la UI o visuales, adjunta capturas de pantalla o GIFs.
🔗: Enlaces Adicionales
Si aplica, agrega enlaces a documentación externa, discusiones relevantes o ejemplos similares.
⏰: Consideraciones Especiales
Menciona cualquier detalle importante a considerar antes de aprobar este PR. Por ejemplo: nuevas dependencias, riesgos potenciales o ajustes necesarios en el futuro.
🟥: Problemas Relacionados
Cierra #123 (reemplaza 123 con el número del problema relacionado).
Note
Make technical career creation robust by treating 201 responses surfaced as errors as successful and returning the created id in both admin and careers services.
features/administration/services/technical-career-service.tscreateto wrap POST intry/catch, treatingerror.response.status === 201as success and returningid.features/careers/services/technical-career-service.tscreatelogic to handle 201-as-success and returnid.Written by Cursor Bugbot for commit 6ee7a6c. This will update automatically on new commits. Configure here.