Hi Jorge,

I don't have any time available today as I'm in meetings all day in SA.  Do you have time to add this today?

Thanks,

Greg

From: Jorge Williams <notifications@github.com<mailto:notifications@github.com>>
Reply-To: InABlender/api-checker <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Thursday, April 25, 2013 2:31 AM
To: InABlender/api-checker <api-checker@noreply.github.com<mailto:api-checker@noreply.github.com>>
Cc: Greg Sharek <greg.sharek@rackspace.com<mailto:greg.sharek@rackspace.com>>
Subject: Re: [api-checker] Issue: 51: D-12007: API Checker Error Message Propogation (#151)


In core/src/main/scala/step/results.scala:

> +    if ( order != 0 ) {
> +
> +      order
> +    }
> +    else {
> +
> +      stepCount - o.stepCount
> +    }
> +  }
> +
> +  //
> +  // Declares the ordering for the different Result types.  The bigger number
> +  // has the highest priority.  If Result type not found in match statement,
> +  // gives it least priority.
> +  //
> +  def orderValue() = {


The base abstract class should generally not have to be aware of its children.

I recommend that you set orderValue here to be 0. Then override the value in each of the children.

For convenience you might want to pass order value in the constructor the way that you do for code etc.

So you can define the child classes like this:

class URLFailResult(message : String,
                   uriLevel : Int,
                    stepId : String,
                    stepCount: Int) extends ErrorResult(message, 404, uriLevel, stepId, stepCount, 60)


Where 60 is the order value.

—
Reply to this email directly or view it on GitHub<https://github.com/InABlender/api-checker/pull/151/files#r3952606>.