How to use getResponseError()

For example, if the response error content is {“message”:“File size exceeds the maximum allowed size”} within getResponseError, I want to retrieve the detailed error message “File size exceeds the maximum allowed size”, but using error.message only returns “Upload error”.
How can I access the specific error message returned later in the code?

let uppy = new Uppy.Uppy();
uppy.use(Uppy.Dashboard, {
	 inline: true
	 , bundle: true
	 , height: 500
	 , width: 900
	 , target: '#uppy'
	 , method: 'post'
 .use(Uppy.XHRUpload, {
	 endpoint: 'server.php',
	 getResponseError(content, xhr) { 
		return JSON.parse(content);

uppy.on('upload-error', (file, error) => {
		const errorMessage = error.message; 
		console.error('Upload error:', errorMessage);

Hi, I’m not sure what’s going on here. But if you want you can upgrade to the 4.0 beta (stable, but breaking changes) of Uppy and you’ll get new xhr hooks like onBeforeRequest, shouldRetry, and onAfterResponse.