Skip to content

[Bug]: Invalid If-Match value returns 500 instead of 400 #3397

@JerryNixon

Description

@JerryNixon

Invalid If-Match value returns 500 instead of 400

Designed behavior

If-Match: — Rejected; 400 Bad Request (Etags not supported, use '*')

Actual behavior

Returns 500 Internal Server Error with an empty body.

{"error":{"code":"DatabaseOperationFailed","message":"Cannot insert the value NULL into column 'completed'..."}}

Repro

curl -s -w "\nHTTP_CODE:%{http_code}" \
  -X PUT "http://localhost:5000/api/Todo/id/6" \
  -H "Content-Type: application/json" \
  -H 'If-Match: "abc123"' \
  -d '{"title":"bad etag","completed":false}'
# Expected: 400 Bad Request with {"error":"Etags not supported, use '*'"}
# Actual: 500 Internal Server Error (empty body)

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions