Hi Dave,

Sorry my bad, I didn't check the backend code, I assumed that it is coming
from psycopg2 and so I was focusing it to remove from client side :(

PFA updated patch.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


On Mon, Sep 18, 2017 at 7:19 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Mon, Sep 18, 2017 at 2:20 PM, Murtuza Zabuawala <murtuza.zabuawala@
> enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Please disregard my previous patch and instead attaching updated patch.
>>
>> In my previous patch I used `let` keyword instead of `var` for defining
>> variable, for consistency & backward compatibility I have used `var` in my
>> latest patch.
>>
>
> That seems like an odd way to fix this - we put in ***** Error ***** in
> the backend, then remove it in the front end.
>
> I think it would be better to ensure it's formatted sensibly at the backed
> to begin with.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py 
b/web/pgadmin/utils/driver/psycopg2/__init__.py
index 11952e1..f22a697 100644
--- a/web/pgadmin/utils/driver/psycopg2/__init__.py
+++ b/web/pgadmin/utils/driver/psycopg2/__init__.py
@@ -1563,7 +1563,7 @@ Failed to reset the connection to the server due to 
following error:
         if not formatted_msg:
             return errmsg
 
-        errmsg += u'********** Error **********\n\n'
+        errmsg = u'ERROR: ' + errmsg + u'\n\n'
 
         if exception_obj.diag.severity is not None \
                 and exception_obj.diag.message_primary is not None:
diff --git a/web/regression/javascript/history/query_history_spec.jsx 
b/web/regression/javascript/history/query_history_spec.jsx
index 0a96244..92e5174 100644
--- a/web/regression/javascript/history/query_history_spec.jsx
+++ b/web/regression/javascript/history/query_history_spec.jsx
@@ -383,6 +383,25 @@ describe('QueryHistory', () => {
           expect(queryDetail.at(0).text()).toContain('third sql statement');
         });
       });
+
+      describe('when a fourth SQL query is executed', () => {
+        beforeEach(() => {
+          historyCollection.add({
+            query: 'fourth sql statement',
+            start_time: new Date(2017, 12, 12, 1, 33, 5, 99),
+            status: false,
+            row_affected: 0,
+            total_time: '26 msec',
+            message: 'ERROR: unexpected error from fourth sql message',
+          });
+
+          queryEntries = historyWrapper.find(QueryHistoryEntry);
+        });
+
+        it('displays fourth query SQL in the right pane', () => {
+          expect(queryDetail.at(0).text()).toContain('Error Message unexpected 
error from fourth sql message');
+        });
+      });
     });
 
     describe('when several days of queries were executed', () => {

Reply via email to