pass the input file as opts={file:...} everywhere
unified approach to error reporting