[ailyasov] update reader/writer - output error for bad files instead of runtime_exception