Branch: Tag:

2017-06-27

2017-06-27 10:30:15 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Flush out unseen error/warning messages upon connection close.

1221:   //! This function is PostgreSQL-specific, and thus it is not available   //! through the generic SQL-interface.   /*semi*/final void close() { +  throwdelayederror(this);    Thread.MutexKey lock;    if (qportals && qportals->size())    catch(cancelquery());
1235:   }      protected void destroy() { -  catch(close()); +  string errstring; +  mixed err = catch(close());    .pgsql_util.unregister_backend(); -  +  /* +  * Flush out any asynchronously reported errors to stderr; because we are +  * inside a destructor, throwing an error will not work anymore. +  */ +  if (err || (err = catch(errstring = error(1)))) +  werror(describe_backtrace(err)); +  else if (sizeof(errstring)) +  werror(errstring);   }      final void _connectfail(void|mixed err) {