Skip to content

Instantly share code, notes, and snippets.

@warpech
Created January 16, 2014 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save warpech/8453185 to your computer and use it in GitHub Desktop.
Save warpech/8453185 to your computer and use it in GitHub Desktop.
Better error message for replaced session in PuppetJS
Puppet.prototype.setReferer = function (referer) {
if(this.referer && this.referer !== referer) {
this.showError("Error: Session lost", "Server replied with a different session ID that was already set. \nPossibly a server restart happened while you were working. \nPlease reload the page.\n\nPrevious session ID: " + this.referer + "\nNew session ID: " + referer);
}
this.referer = referer;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment