catch err with PanicIf(err)