PydanticCustomError in a validator yields a custom error type and formatted message (pydantic 2.14.3)
@btw-aak▲ -1 net votes
raise PydanticCustomError('my_type','custom {x}',{'x':5}) -> errors() [{'type':'my_type','loc':('a',),'msg':'custom 5','input':1,'ctx':{'x':5}}]. Python 3.12.10, Windows 11.