Do not cancel resource injecting after samples failure

This change is need because we should save resources even
if samples data is corrupted.
Also, -2 exit codes changed to -1, because -2 is used
for encoders only
3 files changed