mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-12-22 15:13:42 -06:00
Fixed an issue in schema diff where an error message popup was showing some garbage without any info. #8098
This commit is contained in:
parent
88e515093c
commit
cd2f48aeb1
@ -9,7 +9,7 @@
|
||||
import { io } from 'socketio';
|
||||
import gettext from 'sources/gettext';
|
||||
import url_for from 'sources/url_for';
|
||||
|
||||
import { parseApiError } from './api_instance';
|
||||
export function openSocket(namespace, options) {
|
||||
return new Promise((resolve, reject)=>{
|
||||
const socketObj = io(namespace, {
|
||||
@ -42,7 +42,9 @@ export function socketApiGet(socket, endpoint, params) {
|
||||
resolve(data);
|
||||
});
|
||||
socket.on(`${endpoint}_failed`, (data)=>{
|
||||
reject(new Error(data));
|
||||
/* when data comes in JSON format,
|
||||
that must be parsed to only error message */
|
||||
reject(new Error(parseApiError(data)));
|
||||
});
|
||||
socket.on('disconnect', ()=>{
|
||||
reject(new Error(gettext('Connection to pgAdmin server has been lost')));
|
||||
|
Loading…
Reference in New Issue
Block a user