Add EntityError class and emit on errors (WIP)