chore(resource): use minErr to throw exception
chore(sanitize): use minErr to throw exception