error handling in migrate command