Skip to content

Commit

Permalink
alerts-server: Move ErrorId to commons package
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed Feb 24, 2018
1 parent 3fb2bb2 commit b4679b4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.alexitc.coinalerts.commons
import javax.inject.Inject

import com.alexitc.coinalerts.commons.FutureOr.Implicits.{FutureOps, OrOps}
import com.alexitc.coinalerts.core.{ErrorId, MessageKey}
import com.alexitc.coinalerts.core.MessageKey
import org.scalactic.{Bad, Every, Good}
import play.api.i18n.Lang
import play.api.libs.json._
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.alexitc.coinalerts.commons

import java.util.UUID

case class ErrorId(string: String) extends AnyVal

object ErrorId {
def create: ErrorId = ErrorId(UUID.randomUUID().toString.replace("-", ""))
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.alexitc.coinalerts.commons

import com.alexitc.coinalerts.core.ErrorId
import play.api.libs.json.{JsValue, Json}

class PublicErrorRenderer {
Expand Down
6 changes: 0 additions & 6 deletions alerts-server/app/com/alexitc/coinalerts/core/ErrorId.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package com.alexitc.coinalerts.errors

import javax.inject.{Inject, Singleton}

import com.alexitc.coinalerts.commons.{PublicError, PublicErrorRenderer}
import com.alexitc.coinalerts.core.ErrorId
import com.alexitc.coinalerts.commons.{ErrorId, PublicError, PublicErrorRenderer}
import org.slf4j.LoggerFactory
import play.api.http.HttpErrorHandler
import play.api.libs.json.Json
Expand Down
3 changes: 1 addition & 2 deletions alerts-server/app/controllers/MyJsonController.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package controllers

import com.alexitc.coinalerts.commons.{AbstractJsonController, ServerError}
import com.alexitc.coinalerts.core.ErrorId
import com.alexitc.coinalerts.commons.{AbstractJsonController, ErrorId, ServerError}
import org.slf4j.LoggerFactory

class MyJsonController (components: MyJsonControllerComponents) extends AbstractJsonController(components) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.alexitc.coinalerts.commons.examples

import com.alexitc.coinalerts.commons.{AbstractJsonController, ServerError}
import com.alexitc.coinalerts.core.ErrorId
import com.alexitc.coinalerts.commons.{AbstractJsonController, ErrorId, ServerError}
import org.slf4j.LoggerFactory

class CustomJsonController (components: CustomControllerComponents) extends AbstractJsonController(components) {
Expand Down

0 comments on commit b4679b4

Please sign in to comment.