Use the make-error package.