public new static UnresolvedErr make(string msg, Err cause) { UnresolvedErr err = new UnresolvedErr(); make_(err, msg, cause); return(err); }
public static UriScheme find(string scheme, bool check) { // check cache lock (m_cache) { UriScheme cached = (UriScheme)m_cache[scheme]; if (cached != null) { return(cached); } } try { // lookup scheme type (avoid building index for common types) Type t = null; if (scheme == "fan") { t = Sys.FanSchemeType; } if (scheme == "file") { t = Sys.FileSchemeType; } if (t == null) { string qname = (string)Env.cur().index("sys.uriScheme." + scheme).first(); if (qname == null) { throw UnresolvedErr.make().val; } t = Type.find(qname); } // allocate instance UriScheme s = (UriScheme)t.make(); s.m_scheme = scheme; // add to cache lock (m_cache) { UriScheme cached = (UriScheme)m_cache[scheme]; if (cached != null) { return(cached); } m_cache[scheme] = s; } return(s); } catch (UnresolvedErr.Val) {} catch (System.Exception e) { Err.dumpStack(e); } if (!check) { return(null); } throw UnresolvedErr.make("Unknown scheme: " + scheme).val; }
////////////////////////////////////////////////////////////////////////// // Find Files ////////////////////////////////////////////////////////////////////////// public override File findFile(Uri uri, bool check) { if (uri.isPathAbs()) { throw ArgErr.make("Uri must be relative: " + uri).val; } File f = m_homeDir.plus(uri, false); if (f.exists()) { return(f); } if (!check) { return(null); } throw UnresolvedErr.make("File not found in Env: " + uri).val; }
public Fan.Sys.File file(Uri uri, bool check) { loadFiles(); if (!uri.isPathAbs()) { throw ArgErr.make("Pod.files Uri must be path abs: " + uri).val; } if (uri.auth() != null && !uri.toStr().StartsWith(this.uri().toStr())) { throw ArgErr.make("Invalid base uri `" + uri + "` for `" + this.uri() + "`").val; } else { uri = this.uri().plus(uri); } Fan.Sys.File f = (Fan.Sys.File)m_filesMap[uri]; if (f != null || !check) { return(f); } throw UnresolvedErr.make(uri.toStr()).val; }
public static void make_(UnresolvedErr self, string msg, Err cause) { Err.make_(self, msg, cause); }
public static void make_(UnresolvedErr self, string msg) { make_(self, msg, null); }
public static void make_(UnresolvedErr self) { make_(self, null); }
public static new UnresolvedErr make(string msg, Err cause) { UnresolvedErr err = new UnresolvedErr(); make_(err, msg, cause); return err; }