前田です。

At Tue, 27 Jul 1999 15:37:51 +0900,
goto / yokogawa-kouji.co.jp wrote:
> res = conn.exec("copy s_jyunpou_table from '#{jyunpou}' using delimiters ',';")
> if res == nil then
>   err_message="s_jyunpou_tableのcopyに失敗しました。"
>   print err_message + "\n"
>   exec("echo #{err_message} | /usr/sbin/sendmail goto / yokogawa-kouji.co.jp")
> end

begin
  conn.exec("copy s_jyunpou_table from '#{jyunpou}' using delimiters ',';")
rescue PGError
   err_message="s_jyunpou_tableのcopyに失敗しました。"
   print err_message + "\n"
   system("echo #{err_message} | /usr/sbin/sendmail goto / yokogawa-kouji.co.jp")
end

のようにrescueで例外を捕捉してやればOKです。

-- 
前田 修吾