feat(core): add some error check and reject promises