That information is not provided as a field on the Exception. You can use the getMessage()
method to get some information about the cause. Like UNIQUE constraint failed: event.id
as an example. This is telling you the name and the column which violated the constraint, but not the name of the constraint which is violated.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…