<@U04UQ68083H> I am using the `@ory/client` in my ...
# ory-copilot
i
@chilly-king-10285 I am using the
@ory/client
in my application and want to establish some logging mechanics, which response codes are indicated that the ory itself might have issues and which can I ignore for logging
c
A message from kapa.ai
The Ory API provides several HTTP status codes that can help you understand the state of your requests. Here are some of the status codes you might encounter: 1. `204 No Content`: This status code is typically sent when resources are deleted. It indicates that the operation was successful, and there's no additional content to send in the response payload body. You can generally ignore this for logging unless you're specifically tracking resource deletions. [Source](https://www.ory.sh/docs/reference/api#ory-api-reference--ory-apis---frontend--methods--performnativelogout--responses-part-1) 2. `400 Bad Request`: This status code indicates that the server could not understand the request due to invalid syntax. The response will include a JSON object with details about the error, including a description, debug information, error name, further information on the nature of the error, the error message, and the status code. This is an important status code to log as it indicates issues with the requests being sent to the API. [Source](https://www.ory.sh/docs/reference/api#ory-api-reference--ory-apis---frontend--methods--createnativeloginflow--responses-part-20) 3. `401 Unauthorized`: This status code is similar to 403 but specifically for cases where authentication is required and has failed or not yet been provided. The response will include a JSON object with details about the error. This is another important status code to log as it indicates authentication issues. [Source](https://www.ory.sh/docs/reference/api#ory-api-reference--ory-apis---frontend--methods--disablemyothersessions--responses-part-2) 4. `303 See Other`: This status code is typically used to redirect the client to another URL for the completion of the request. It's not necessarily indicative of an error, but you may want to log it if you're tracking redirects. [Source](https://www.ory.sh/docs/reference/api#ory-api-reference--ory-apis---frontend--methods--updateloginflow--responses-part-10) Remember, the information provided in the error responses can be very useful for debugging issues with your application's interaction with the Ory API.
i
@chilly-king-10285 but I only want to log erros that might indicate that the login mechanics are not working as expected, I do not want to log if the user enters a wrong password or is unauthorized e.g.
c
A message from kapa.ai
New message text here
i
@chilly-king-10285 I am talking about serverside issues here, basically i would log ever exception greater 499, are there any other exception code which could indicate that ory itself has a problem
c
A message from kapa.ai
Yes, you're correct. In HTTP, status codes in the 500 range are typically indicative of server-side errors. Here are some examples from the Ory API: 1. `500 Internal Server Error`: This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. The response will include a JSON object with details about the error, including a description, debug information, error name, further information on the nature of the error, the error message, and the status code. This is a critical status code to log as it indicates issues with the Ory server itself. [Source](https://www.ory.sh/docs/reference/api#ory-api-reference--ory-apis---frontend--methods--createbrowserlogoutflow--responses-part-3) Remember, while status codes in the 500 range are generally indicative of server-side errors, the specific cause of the error can vary. The information provided in the error response can be very useful for debugging these issues.