Search Postgresql Archives

Re: server-side extension in c++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> It's good to have actual working code in production to bolster the
> case that the design is sound.
>
> How much work would it be to refactor libgeos_c to use a catch-all
> exception handler?
>

Well, they'd have to be using specific exception handlers to get the
error message. Perhaps they just have one per wrapper function like
this (assuming their exception objects ultimately inherit from
std::exception, which they all ought to):

...
char* error_string;
...
catch(const std::exception& e)
{
    error_string = malloc(strlen(e.what()) + 1 );
    if(error_string != NULL)
         strcpy(error_string, e.what());
    return false;
}
// They could add this catch-all, which we could fall back on to be on
the safe side
catch(...)
{
   // We can't do anything except swallow - this could be anything
that doesn't inherit from std::exception
}

-- 
Regards,
Peter Geoghegan

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux