Problem
When the API returns an error response, the response lacks context regarding:
- The exact server time the error occurred (
timestamp).
- The exact request path that triggered the error (
path).
This makes troubleshooting difficult. Front-end developers or support staff report errors but cannot easily link a specific failure report to server logs without guessing the timestamp or URL.
Proposed Solution
Add timestamp and path fields to the error payload schema. If Issue 27 is implemented first, these fields will be part of the unified ApiResponse<T>. If not, update ErrorResponse.java to include these fields, and populate them in all exception handler methods using Spring's HttpServletRequest or WebRequest.
User Stories
- As an API client, I want error payloads to contain a timestamp and request path so I can log detailed context for troubleshooting.
- As an operations engineer, I want clients to report the exact timestamp and endpoint path from their failed API responses so I can correlate them directly to logging aggregators (e.g., Datadog, ELK).
Acceptance Criteria
Proposed Technical Details
// If extending standard ErrorResponse before full unification:
@Data
public class ErrorResponse {
private int statusCode;
private String error;
private String message;
private String errorCode;
private Instant timestamp;
private String path;
}
Tasks
Problem
When the API returns an error response, the response lacks context regarding:
timestamp).path).This makes troubleshooting difficult. Front-end developers or support staff report errors but cannot easily link a specific failure report to server logs without guessing the timestamp or URL.
Proposed Solution
Add
timestampandpathfields to the error payload schema. If Issue 27 is implemented first, these fields will be part of the unifiedApiResponse<T>. If not, updateErrorResponse.javato include these fields, and populate them in all exception handler methods using Spring'sHttpServletRequestorWebRequest.User Stories
Acceptance Criteria
timestamp(Instant) andpath(String) fields exist in the error response JSON.2026-06-20T16:44:54Z).pathfield returns the request URI (excluding query parameters).HttpServletRequest.Proposed Technical Details
Tasks
ErrorResponse.javaor verify their presence in the newly unifiedApiResponse.java.HttpServletRequestinto each exception handler method signature inGlobalExceptionHandler.java.timestampwithInstant.now()andpathwithrequest.getRequestURI().