You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if it is a bug or intended behaviour. When convenient errors are enabled and used, the error handler is not called when an endpoint's handler implementation returns an error.
What version of ogen are you using?
$ go list -m github.com/ogen-go/ogen
github.com/ogen-go/ogen v0.81.0
Can this issue be reproduced with the latest version?
Yes
What did you do?
Created a temp directory, ran go mod init example.com/test/test in it.
Created a file api.yml with the following content:
openapi: 3.0.2servers:
- url: /v3info:
version: 1.0.0title: Pet store schematags:
- name: petdescription: Everything about your Petspaths:
/pets:
get:
tags:
- petssummary: Get all petsdescription: Returns all petsoperationId: getPetsresponses:
'200':
description: successful operationcontent:
application/json:
schema:
type: arrayitems:
$ref: '#/components/schemas/Pet'default:
description: unexpected errorcontent:
application/json:
schema:
type: objectrequired:
- error_messageproperties:
error_message:
description: A description of the errortype: stringcomponents:
schemas:
Pet:
type: objectrequired:
- nameproperties:
id:
type: integerformat: int64example: 10name:
type: stringexample: doggiephotoUrls:
type: arrayitems:
type: string
Ran the following command to generate code: ogen --target gen --package gen --clean api.yml in the temporary directory.
Created a main.go file in the temporary directory with the following content:
TL;DR
Not sure if it is a bug or intended behaviour. When convenient errors are enabled and used, the error handler is not called when an endpoint's handler implementation returns an error.
What version of ogen are you using?
Can this issue be reproduced with the latest version?
Yes
What did you do?
go mod init example.com/test/test
in it.api.yml
with the following content:ogen --target gen --package gen --clean api.yml
in the temporary directory.main.go
file in the temporary directory with the following content:go run main.go
in the temporary directory.curl localhost:8080/pets
In a separate terminal windowWhat did you expect to see?
The expectation was to see a print out
trying to log this error: get pets error
In the terminal window that was runninggo run main.go
command.What did you see instead?
No print out of the expected message was seen.
The text was updated successfully, but these errors were encountered: