sample: replace a few ctx.error calls by ctx.report calls with

error-specific Diagnostic subclass