Revision: 2140
          http://synfig.svn.sourceforge.net/synfig/?rev=2140&view=rev
Author:   dooglus
Date:     2008-10-26 20:44:20 +0000 (Sun, 26 Oct 2008)

Log Message:
-----------
Rather than reporting "Couldn't create parsing context" when a file isn't 
readable or doesn't exist, report "Can't open file <filename>".

Modified Paths:
--------------
    synfig-core/trunk/src/synfig/loadcanvas.cpp

Modified: synfig-core/trunk/src/synfig/loadcanvas.cpp
===================================================================
--- synfig-core/trunk/src/synfig/loadcanvas.cpp 2008-10-26 20:44:10 UTC (rev 
2139)
+++ synfig-core/trunk/src/synfig/loadcanvas.cpp 2008-10-26 20:44:20 UTC (rev 
2140)
@@ -174,7 +174,7 @@
 {
        string str=strprintf("%s:<%s>:%d: error: 
",filename.c_str(),element->get_name().c_str(),element->get_line())+text;
        total_errors_++;
-       errors_text += "  " + str + "\n";
+       errors_text += "  * " + str + "\n";
        if(!allow_errors_)
                throw runtime_error(str);
        cerr<<str<<endl;
@@ -2082,12 +2082,12 @@
 Canvas::Handle
 CanvasParser::parse_from_file_as(const String &file_,const String &as_,String 
&errors)
 {
+       ChangeLocale change_locale(LC_NUMERIC, "C");
+       String file(unix_to_local_path(file_));
+       String as(unix_to_local_path(as_));
+
        try
        {
-        ChangeLocale change_locale(LC_NUMERIC, "C");
-               String file(unix_to_local_path(file_));
-               String as(unix_to_local_path(as_));
-
                if(get_open_canvas_map().count(etl::absolute_path(as)))
                        return get_open_canvas_map()[etl::absolute_path(as)];
 
@@ -2123,6 +2123,13 @@
        catch(Exception::FileNotFound) { synfig::error("FileNotFound Thrown"); }
        catch(Exception::IDNotFound) { synfig::error("IDNotFound Thrown"); }
        catch(Exception::IDAlreadyExists) { synfig::error("IDAlreadyExists 
Thrown"); }
+       catch(xmlpp::internal_error x)
+       {
+               printf("caught internal error\n");
+               if (!strcmp(x.what(), "Couldn't create parsing context"))
+                       throw runtime_error(String("  * ") + _("Can't open 
file") + " \"" + file + "\"");
+               throw;
+       }
        catch(const std::exception& ex)
        {
                synfig::error("Standard Exception: "+String(ex.what()));


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to