concept error in category scala

This is an excerpt from Manning's book Reactive Design Patterns.
We will start with a naive implementation to retrieve an image from a database. The application has a controller that first checks a cache to see whether the image has been retrieved recently. If the controller finds the image in the cache, it returns the image right away. If not, it tries to retrieve the image from the database. If it finds the image there, the image is added to the cache and also returned to the original requester. If the image is not found, a static fallback image is returned, to avoid presenting the user with an error. This pattern should be familiar to you. This simplistic controller might contain code like the following.
A failure is an unexpected event within a service that prevents it from continuing to function normally. A failure will generally prevent responses to the current, and possibly all following, client requests. This is in contrast with an error, which is an expected and coded-for condition—for example an error discovered during input validation, that will be communicated to the client as part of the normal processing of the message. Failures are unexpected and will require intervention before the system (see section C.2.16) can resume at the same level of operation. This does not mean that failures are always fatal, rather that some capacity of the system will be reduced following a failure. Errors are an expected part of normal operations, are dealt with immediately and the system will continue to operate at the same capacity following an error.

This is an excerpt from Manning's book sbt in Action.
> settings This is a list of settings defined for the current project. It does not list the scopes the settings are defined in; use the 'inspect' command for that. autoCompilerPlugins If true, enables automatically ... autoScalaLibrary Adds a dependency on scala-library ... baseDirectory The base directory. Depending on ... classDirectory Directory for compiled classes ... crossPaths If true, enables cross paths, ... fork If true, forks a new JVM when ... initialCommands Initial commands to execute ... javaHome Selects the Java installation used ... javaSource Default Java source directory. libraryDependencies Declares managed dependencies. managedResourceDirectories List of managed resource directories. maxErrors The maximum number of errors, such ... name Project name. offline Configures sbt to work without ... organization Organization/group ID. publishArtifact Enables or disables publishing ... publishTo The resolver to publish to. resourceDirectory Default unmanaged resource ... scalaHome If Some, defines the local Scala ... scalaSource Default Scala source directory. scalaVersion The version of Scala used for building. sourceDirectories List of all source directories ... sourceDirectory Default directory containing sources. target Main directory for files generated ... unmanagedBase The default directory for manually ... unmanagedResourceDirectories Unmanaged resource directories ... unmanagedSourceDirectories Unmanaged source directories, which ... version The version/revision of the current ... More settings may be viewed by increasing verbosity. See 'help settings'.
> test [info] Compiling 1 Scala source to /home/jsuereth/kittens/target/scala-2.9.2/test-classes... [info] LogicSpec [info] [info] The 'matchLikelihood' method should [info] + be 100% when all attributes match [info] [info] [info] Total for specification LogicSpec [info] Finished in 37 ms [info] 1 example, 0 failure, 0 error [info] [info] Passed: : Total 1, Failed 0, Errors 0, Passed 1, Skipped 0 [success] Total time: 3 s, completed Jan 21, 2013 2:05:32 PM >You can see that sbt automatically compiles the test and runs it. The output from specs2 is quite detailed, outlining every test and specification that passes. One of the benefits of using a testing framework like specs2 is the robust output for errors. Note: testing is covered in more depth in chapter 5.
In this failure, the first item (what’s being resolved) is where the error is. In this case, the organization org.scala-lang was misspelled. But it may be hard to spot such a misspelling at first. The second step in debugging is to start looking at where Ivy was trying to resolve artifacts. The debugging output is repeated here:

This is an excerpt from Manning's book Functional Programming in Scala.
Throwing an exception or halting with an error
Chapter 4. Handling errors without exceptions
We noted briefly in chapter 1 that throwing exceptions is a side effect. If exceptions aren’t used in functional code, what is used instead? In this chapter, we’ll learn the basic principles for raising and handling errors functionally. The big idea is that we can represent failures and exceptions with ordinary values, and we can write higher-order functions that abstract out common patterns of error handling and recovery. The functional solution, of returning errors as values, is safer and retains referential transparency, and through the use of higher-order functions, we can preserve the primary benefit of exceptions—consolidation of error-handling logic. We’ll see how this works over the course of this chapter, after we take a closer look at exceptions and discuss some of their problems.
For the same reason that we created our own List data type in the previous chapter, we’ll re-create in this chapter two Scala standard library types: Option and Either. The purpose is to enhance your understanding of how these types can be used for handling errors. After completing this chapter, you should feel free to use the Scala standard library version of Option and Either (though you’ll notice that the standard library versions of both types are missing some of the useful functions we define in this chapter).
Listing 4.3. Using Option
def parseInsuranceRateQuote( age: String, numberOfSpeedingTickets: String): Option[Double] = { val optAge: Option[Int] = Try(age.toInt) #1 val optTickets: Option[Int] = Try(numberOfSpeedingTickets.toInt) insuranceRateQuote(optAge, optTickets) #2 } def Try[A](a: => A): Option[A] = #3 try Some(a) catch { case e: Exception => None } #4 #1: The toInt method is available on any String. #2: Doesn’t type check! See following discussion. #3: We accept the A argument non-strictly, so we can catch any exceptions that occur while evaluating a and convert them to None. #4: Note: This discards information about the error. We’ll improve on this later in the chapter.