Skip to content

Fix: Improve logs for insert login credentials #37

@AlexTraveylan

Description

@AlexTraveylan

Describe the bug
Insert a login don't log error when fail.

To Reproduce
Steps to reproduce the behavior:

  1. curl -X POST "http://localhost:3000/api/login/insert?projectName=code-smell" -H "Content-Type: application/json" -d "{"login": {"authentication_url": "https://www.alextraveylan.fr/fr", "username": "toto", "password": "azerty"}}"
  2. It log :
    ecosonar_api | [LOGGER] 2024-11-04 09:05:15 info : INSERT LOGIN CREDENTIALS - insert credentials
    ecosonar_api | [LOGGER] 2024-11-04 09:05:35 error : %s
    ecosonar_api | [LOGGER] 2024-11-04 09:05:35 error : [object Object]
    ecosonar_api | [LOGGER] 2024-11-04 09:05:35 error : INSERT LOGIN CREDENTIALS - insert credentials into project code-smell encountered an error
  3. curl again
  4. It log :
    ecosonar_api | [LOGGER] 2024-11-04 09:14:47 info : INSERT LOGIN CREDENTIALS - insert credentials into project code-smell
    ecosonar_api | [LOGGER] 2024-11-04 09:14:51 info : INSERT LOGIN CREDENTIALS - insert succeeded

Expected behavior
It look i didnt understand how to register login_url but readable error should be usefull, i expect a beter error than "error : %s [object Object]".
And when i retry, i expect an error, the same behavior should log the same error, not a succes log.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: windows
  • Browser: chrome
  • Version win10 22H2, chrome 130.0.6723.92

Additional context
Maybe fix the doc for this part, i have finally no idea how to register login_url, i thought i have follow the doc but it fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions