fix Hat#error
add tests for Hat#getDumpPath and Hat#error