You can't do that when doing trim, as the transaction wouldn't be applied if you return an error.