#13: add error logging