Creates AppError function and improves error reporting in configuration module