raise error when repo is empty or nil. fixed #2
refactor error handling
version 0.0.4