Skip to content

Commit cd2f48a

Browse files
authored
Fixed an issue in schema diff where an error message popup was showing some garbage without any info. #8098
1 parent 88e5150 commit cd2f48a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

web/pgadmin/static/js/socket_instance.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { io } from 'socketio';
1010
import gettext from 'sources/gettext';
1111
import url_for from 'sources/url_for';
12-
12+
import { parseApiError } from './api_instance';
1313
export function openSocket(namespace, options) {
1414
return new Promise((resolve, reject)=>{
1515
const socketObj = io(namespace, {
@@ -42,7 +42,9 @@ export function socketApiGet(socket, endpoint, params) {
4242
resolve(data);
4343
});
4444
socket.on(`${endpoint}_failed`, (data)=>{
45-
reject(new Error(data));
45+
/* when data comes in JSON format,
46+
that must be parsed to only error message */
47+
reject(new Error(parseApiError(data)));
4648
});
4749
socket.on('disconnect', ()=>{
4850
reject(new Error(gettext('Connection to pgAdmin server has been lost')));

0 commit comments

Comments
 (0)