datasmart_erl: Improve error handling of dcmd