Hi,
I've been running a personal TW5 on node.js now for many months, and 
thoroughly enjoying it!  I run my server locally and use git to version 
control and share my wiki between several different machines. While I've 
never had the node.js process problem that I can recall, occasionally I do 
encounter a problem "between the keyboard and the chair" as they say. A few 
times now I'll stop the server to commit my tiddlers, or update the TW5 
code base, but forget to start the server back up, doh! 

The browser window I leave open to the wiki happily continues working even 
though the sync requests to the server are not successful. So if you're not 
careful, and I'm not, you'll lose any changes you're making till you notice 
the server is down (e.g. you refresh the browser page).

I'd like to see a prominent notification in the browser of any sync errors. 
In looking at it, I think a very small change could do this nicely. In the 
core/modules/syncer.js :

/*
Error handling
*/
Syncer.prototype.showError = function(error) {
$tw.utils.error("Error: " + error);
this.log("Error: " + error);
};


Just adding a call to the $tw.utils.error displays a nicely styled 
notification. Can't miss it! 

One idea which could make the $tw.utils.error notification a little more 
appropriate for this message, and perhaps more generally useful in other 
areas. The current errHeading and promptMessage could be converted to 
optional arguments with default values.

/*
Display an error and exit
*/
$tw.utils.error = function(err, heading /*opt*/, message /*opt*/) {
// Prepare the error message
var errHeading = heading ? heading : "Internal JavaScript Error",
promptMsg = message ? message : "Well, this is embarrassing. It is 
recommended that you restart TiddlyWiki by refreshing your browser";
// Log the error to the console


To allow the notification to use messages like "Sync Error", "Connection to 
the server has been interuprted" etc.

I'm running these changes locally now, and be happy to submit a pull 
request if they sound appropriate.

Thanks,
Brian..

 


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to