Adapt to new error class structure