Function getErrorMap