More descriptive error handling

Add DotError class and tests