Modify to work with new api
More verbose exceptions