diff --git a/web-server/app/views/searchBoxError.scala.html b/web-server/app/views/searchBoxError.scala.html
new file mode 100644
index 0000000..a747104
--- /dev/null
+++ b/web-server/app/views/searchBoxError.scala.html
@@ -0,0 +1,107 @@
+@(errorMessageT: String)
+
+
+
diff --git a/web-server/app/views/searchResults.scala.html b/web-server/app/views/searchResults.scala.html
index c949666..4339d7b 100644
--- a/web-server/app/views/searchResults.scala.html
+++ b/web-server/app/views/searchResults.scala.html
@@ -1,29 +1,25 @@
-@import codesearch.core.search.Search.PackageResult
-
+@import codesearch.core.search.{ErrorResponse, Response, SuccessResponse}
@(
- updated: String,
- packages: Seq[PackageResult],
- query: String,
- filter: Option[String],
- filePath: Option[String],
- insensitive: Boolean,
- space: Boolean,
- precise: Boolean,
- sources: Boolean,
- page: Int,
- totalMatches: Int,
- callURI: String,
- lang: String
+ response: Response
)
- @headExtra = {
-
-
-
- }
+@headExtra = {
+
+
+
+}
- @wrapper(s"Codesearch | $lang", headExtra) {
- @searchBox(s"/$lang/search", query, filter, filePath, insensitive, space, precise, sources)
- @resultFrame(lang, insensitive, space, precise, query, updated, packages, totalMatches)
- @pagination(page, totalMatches, callURI)
+@response match {
+ case SuccessResponse(updated, packages, query, filter, filePath, insensitive, space, precise, sources, page, totalMatches, callURI, lang) => {
+ @wrapper(s"Codesearch | $lang", headExtra) {
+ @searchBox(s"/$lang/search", query, filter, filePath, insensitive, space, precise, sources)
+ @resultFrame(lang, insensitive, space, precise, query, updated, packages, totalMatches)
+ @pagination(page, totalMatches, callURI)
+ }
+ }
+ case ErrorResponse(message) => {
+ @wrapper(s"Codesearch ", headExtra) {
+ @searchBoxError(message)
+ }
}
+ }
diff --git a/web-server/app/views/sourceCode.scala.html b/web-server/app/views/sourceCode.scala.html
index 0a84ee7..b489f7c 100644
--- a/web-server/app/views/sourceCode.scala.html
+++ b/web-server/app/views/sourceCode.scala.html
@@ -1,9 +1,9 @@
@import codesearch.core.search.Search.Package
-@import scala.collection.mutable
-@import scala.collection.mutable.ListBuffer
-@import scala.collection.immutable
-@import play.twirl.api._
@import codesearch.web.SnippetHelper
+@import play.twirl.api._
+
+@import scala.collection.{immutable, mutable}
+@import scala.collection.mutable.ListBuffer
@(
sourceCode: List[String],