Move and split database entity related exceptions into graph and database exceptions Refactor COG-502