# "Sorry, an error has occurred." for some users when posting

**URL:** <https://meta.discourse.org/t/sorry-an-error-has-occurred-for-some-users-when-posting/308482>\
**Category:** Support\
**Created:** [May 17, 2024, 9:03pm UTC](https://meta.discourse.org/t/sorry-an-error-has-occurred-for-some-users-when-posting/308482 "2024-05-17T21:03:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)\
**Post date:** [May 17, 2024, 9:32pm UTC](https://meta.discourse.org/t/sorry-an-error-has-occurred-for-some-users-when-posting/308482/2 "2024-05-17T21:32:09Z")

</div>

I found it. There was some analytics code like this:

```plaintext
function sendClickyEvent(href, title, type) {
    if (clicky && clicky.log) {
        clicky.log(href, title, type);
    }
}

```

It should be `window.clicky` to avoid an error, but I just wrapped all the analytics code in try/catch blocks to be sure.

It was crashing when posting for users who didn’t load the analytics, because it was trying to send an event to log the creation of the new post.

---

_[View the full topic](https://meta.discourse.org/t/sorry-an-error-has-occurred-for-some-users-when-posting/308482)._
