Message from discussion
ClojureScript: catching all javascript exceptions
Received: by 10.204.6.19 with SMTP id 19mr9015632bkx.8.1351768306006;
Thu, 01 Nov 2012 04:11:46 -0700 (PDT)
X-BeenThere: clojure@googlegroups.com
Received: by 10.204.147.90 with SMTP id k26ls3090227bkv.5.gmail; Thu, 01 Nov
2012 04:11:29 -0700 (PDT)
Received: by 10.204.6.19 with SMTP id 19mr9015584bkx.8.1351768289237;
Thu, 01 Nov 2012 04:11:29 -0700 (PDT)
Received: by 10.204.6.19 with SMTP id 19mr9015583bkx.8.1351768289212;
Thu, 01 Nov 2012 04:11:29 -0700 (PDT)
Return-Path: <neo...@kungfoo.pl>
Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53])
by gmr-mx.google.com with ESMTPS id l1si574491bka.2.2012.11.01.04.11.28
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 01 Nov 2012 04:11:28 -0700 (PDT)
Received-SPF: pass (google.com: domain of neo...@kungfoo.pl designates 209.85.214.53 as permitted sender) client-ip=209.85.214.53;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of neo...@kungfoo.pl designates 209.85.214.53 as permitted sender) smtp.mail=neo...@kungfoo.pl; dkim=pass header...@kungfoo.pl
Received: by mail-bk0-f53.google.com with SMTP id jg15so1030222bkc.12
for <clojure@googlegroups.com>; Thu, 01 Nov 2012 04:11:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=kungfoo.pl; s=google;
h=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type;
bh=9YA1q0WiZgmTmwxSvy50NPEfvbi0YaQ7DOJGOpClD70=;
b=Z0IST02xfnGFA1560N3MN+qHAMsF6HyZSnTRnFKcQN+8HWGZC8fydIB3w3WCdtE6Ki
K6zvmU78qYh/CBkZcTOdz5460xI2c3h1wc7+XFv0tfapIgIANREWX4VDeDpP1OSW5GFL
C9kmgsmIvylCNPVq2YSmsWb61kHyeMdK807Tg=
d=google.com; s=20120113;
h=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type:x-gm-message-state;
bh=9YA1q0WiZgmTmwxSvy50NPEfvbi0YaQ7DOJGOpClD70=;
b=Vjkzc4/1j7FR2CxG/v/3F73jbwzha8FaBsEEFk3DcSC+ew0lycL4rwACsi2A6yrck5
sX7ljk0Qkm12ve/jKOMcV781pT72H8ivknTLOo/ShCO9ToC1GzSxxQhgflNmHKwhtBnN
HzIFoPr7MBdDZzovDcdQ4XdiWDW1hT727ogIqN3LTZwjKkISYiqt4cACYX8SudlGBS/Q
Js2LX2b41TB0Q51ZJHbHp0El6X5DnrOFC4fDF2T01ibTICGvLf5jh/uY67itQdVitAoA
6KhAY1JQz/VmZ26Qc7PQIa+9gLOMiGeQ3SH8hdPg2phIKRV59iuY+gwKazfVZvLckDvk
PuBQ==
Received: by 10.204.128.89 with SMTP id j25mr12150658bks.23.1351768288522;
Thu, 01 Nov 2012 04:11:28 -0700 (PDT)
Return-Path: <neo...@kungfoo.pl>
Received: from antares.local ([37.74.130.145])
by mx.google.com with ESMTPS id x13sm4869034bkv.16.2012.11.01.04.11.21
(version=SSLv3 cipher=OTHER);
Thu, 01 Nov 2012 04:11:23 -0700 (PDT)
Message-ID: <509258D6.1090...@kungfoo.pl>
Date: Thu, 01 Nov 2012 12:11:18 +0100
From: Hubert Iwaniuk <neo...@kungfoo.pl>
User-Agent: Postbox 3.0.6 (Macintosh/20120901)
MIME-Version: 1.0
To: clojure@googlegroups.com
Subject: Re: ClojureScript: catching all javascript exceptions
References: <af65a5f5-cbf2-42c4-b968-9b1ab1e1eb96@googlegroups.com> <37a1e22e-a5d0-42f0-a895-0eadaaba50a9@googlegroups.com> <095E55C5-7C17-4D1E-967B-155C55571...@gmail.com> <f3b62736-2b99-4266-8ec5-2edc86996361@googlegroups.com>
In-Reply-To: <f3b62736-2b99-4266-8ec5-2edc86996361@googlegroups.com>
Content-Type: multipart/alternative;
boundary="------------040402010101030500090209"
X-Gm-Message-State: ALoCoQmBExXukAJMEFchZSuiV2/XrF6u+hsxz8yw4X7D2918xUCHPNrnksebGkQwOqnIhxVnFV3X
This is a multi-part message in MIME format.
--------------040402010101030500090209
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
In past I used (goog.debug.ErrorReporter/install"logError")
It worked great.
HTH,
Hubert.
Steve Buikhuizen wrote:
> No problem. On the client (cljs) you should:
>
> 1. require [goog.debug.ErrorReporter :as reporter]
> 2. (reporter/install"/er")
>
> On the server (I'm using Noir which supplies defpage)
>
> (defpage [:post "/er"] {:keys [error line script trace]}
>
> (service/record-client-error error line script trace)
>
> (str"ACK"))
>
> where record-client-error is a function you create that does whatever
> you want it to do e.g. save to a database, log using log4j or send to
> an aggregator e.g. Loggly
>
> I know this is still pretty brief. If you want more detail, just say
> which part is not clear - I'll happily elaborate
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient
> with your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--------------040402010101030500090209
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000">In past I used <span><meta
charset="utf-8"><span class="p" style="margin: 0px; padding: 0px;
border: 0px; color: rgb(51, 51, 51); font-family: Consolas, 'Liberation
Mono', Courier, monospace; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: 16px; orphans: 2; text-align: start; text-indent: 0px;
text-transform: none; white-space: pre; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); ">(</span><span class="nf"
style="margin: 0px; padding: 0px; border: 0px; color: rgb(153, 0, 0);
font-weight: bold; font-family: Consolas, 'Liberation Mono', Courier,
monospace; font-size: 12px; font-style: normal; font-variant: normal;
letter-spacing: normal; line-height: 16px; orphans: 2; text-align:
start; text-indent: 0px; text-transform: none; white-space: pre; widows:
2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); ">goog.debug.ErrorReporter/install</span><span
style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation
Mono', Courier, monospace; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: 16px; orphans: 2; text-align: start; text-indent: 0px;
text-transform: none; white-space: pre; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); display: inline !important; float:
none; "> </span><span class="s" style="margin: 0px; padding: 0px;
border: 0px; color: rgb(221, 17, 68); font-family: Consolas, 'Liberation
Mono', Courier, monospace; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: 16px; orphans: 2; text-align: start; text-indent: 0px;
text-transform: none; white-space: pre; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); ">"logError"</span><span class="p"
style="margin: 0px; padding: 0px; border: 0px; color: rgb(51, 51, 51);
font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size:
12px; font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 16px; orphans: 2; text-align:
start; text-indent: 0px; text-transform: none; white-space: pre; widows:
2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); ">)</span>
<br>
It worked great.<br>
<br>
HTH,<br>
Hubert.<br>
</span><br>
Steve Buikhuizen wrote:
<blockquote
cite="mid:f3b62736-2b99-4266-8ec5-2edc86996361@googlegroups.com"
type="cite">No problem. On the client (cljs) you should:
<div><ol><li>require [goog.debug.ErrorReporter <span class="s1">:as</span>
reporter]<br></li><li><span class="s1">(</span>reporter/install<span
class="s2"> </span><span class="s3">"/er"</span><span class="s1">)</span><br></li></ol></div>
<div>
<p class="p1">On the server (I'm using Noir which supplies defpage)</p><p
class="p1">
</p><p class="p1"><span class="s1">(</span><span class="s2">defpage</span>
[<span class="s3">:post</span> <span class="s3">"/er"</span>] {<span
class="s3">:keys</span> [error line script trace]}</p><p class="p1"><span
class="s5"> (</span>service/record-client-error error line script
trace)</p>
<p class="p3"><span class="s4"> </span><span class="s5">(</span><span
class="s2">str</span><span class="s4"> </span>"ACK"<span class="s5">)</span><span
class="s1">)</span></p><p class="p3">where record-client-error is a
function you create that does whatever you want it to do e.g. save to a
database, log using log4j or send to an aggregator e.g. Loggly</p><p
class="p3">I know this is still pretty brief. If you want more detail,
just say which part is not clear - I'll happily elaborate</p></div>
-- <br>
You received this message because you are subscribed to the Google<br>
Groups "Clojure" group.<br>
To post to this group, send email to <a class="moz-txt-link-abbreviated" href="mailto:clojure@googlegroups.com">clojure@googlegroups.com</a><br>
Note that posts from new members are moderated - please be patient with
your first post.<br>
To unsubscribe from this group, send email to<br>
<a class="moz-txt-link-abbreviated" href="mailto:clojure+unsubscribe@googlegroups.com">clojure+unsubscribe@googlegroups.com</a><br>
For more options, visit this group at<br>
<a moz-do-not-send="true"
href="http://groups.google.com/group/clojure?hl=en">http://groups.google.com/group/clojure?hl=en</a></blockquote>
</body></html>
--------------040402010101030500090209--