avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@avalon.apache.org
Subject [jira] Created: (RUNTIME-48) Bad error report when supplied block is file that does not exist
Date Sun, 25 Jul 2004 19:13:22 GMT
Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/RUNTIME-48

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: RUNTIME-48
    Summary: Bad error report when supplied block is file that does not exist
       Type: Improvement

     Status: Open
   Priority: Minor

    Project: Merlin Runtime
 Components: 
             CORE
   Fix Fors:
             3.4.0
   Versions:
             3.3.0

   Assignee: Stephen McConnell
   Reporter: Stephen McConnell

    Created: Sun, 25 Jul 2004 12:12 PM
    Updated: Sun, 25 Jul 2004 12:12 PM

Description:
Curently if a file for deployment is included on the command line and the filename is incorrect,
the error report throws a MalformedURLException when instead it should throw a FileNotFoundException.

The following replacement code for resolveURL in merlin/impl DefaultContext correct the problem.

    private URL resolveURL( File base, String value )
    {
        if( value.startsWith( "block:" ) )
        {
            return blockSpecToURL( value );
        }
        else if( value.startsWith( "artifact:" ) )
        {
            return artifactSpecToURL( value );
        }

        try
        {
            return new URL( value );
        }
        catch( Exception e )
        {
            File target = new File( value );
            if( target.exists() )
            {
                return toURL( target );
            }
            else
            {
                target = new File( base, value );
                if( target.exists() )
                {
                    return toURL( target );
                }
                else
                {
                    if( e instanceof MalformedURLException )
                    {
                        FileNotFoundException fnfe = new FileNotFoundException( value );
                        final String error = 
                          "Unable to resolve the block path [" + value + "].";
                        throw new KernelRuntimeException( error, fnfe );
                    }
                    else
                    {
                        final String error = 
                          "Unable to resolve the block path [" + value + "].";
                        throw new KernelRuntimeException( error, e );
                    }
                }
            }
        }
    }



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message