mirror of
				https://github.com/superseriousbusiness/gotosocial
				synced 2025-06-05 21:59:39 +02:00 
			
		
		
		
	[bugfix] Catch json syntax errors in the frontend + display a more helpful message (#804)
* catch json syntax errors * update error msg * re-throw error with cause Co-authored-by: f0x52 <f0x@cthu.lu>
This commit is contained in:
		@@ -184,6 +184,12 @@ module.exports = function oauthClient(config, initState) {
 | 
			
		||||
			} else {
 | 
			
		||||
				return json;
 | 
			
		||||
			}
 | 
			
		||||
		}).catch(e => {
 | 
			
		||||
			if (e instanceof SyntaxError) {
 | 
			
		||||
				throw new Error("Error: The GtS API returned a non-json error. This usually means a network problem, or an issue with your instance's reverse proxy configuration.", {cause: e});
 | 
			
		||||
			} else {
 | 
			
		||||
				throw e;
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user