use Context.reportRuntimeError to report errors. Extend AttachmentWrapper to support more data types for setting attachments.