Additional feedback, thanks.
This commit is contained in:
parent
fb510d5018
commit
d87d9e2e80
2 changed files with 4 additions and 3 deletions
|
|
@ -389,8 +389,8 @@ class CustomMailboxType(mailboxFQN: String) extends MailboxType {
|
||||||
|
|
||||||
override def create(receiver: ActorContext): Mailbox = {
|
override def create(receiver: ActorContext): Mailbox = {
|
||||||
val constructorSignature = Array[Class[_]](classOf[ActorContext])
|
val constructorSignature = Array[Class[_]](classOf[ActorContext])
|
||||||
ReflectiveAccess.createInstance[AnyRef](mailboxFQN, constructorSignature, Array[AnyRef](receiver)) match {
|
ReflectiveAccess.createInstance[Mailbox](mailboxFQN, constructorSignature, Array[AnyRef](receiver)) match {
|
||||||
case Right(instance) ⇒ instance.asInstanceOf[Mailbox]
|
case Right(instance) ⇒ instance
|
||||||
case Left(exception) ⇒
|
case Left(exception) ⇒
|
||||||
throw new IllegalArgumentException("Cannot instantiate mailbox [%s] due to: %s".
|
throw new IllegalArgumentException("Cannot instantiate mailbox [%s] due to: %s".
|
||||||
format(mailboxFQN, exception.toString))
|
format(mailboxFQN, exception.toString))
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,8 @@ object ReflectiveAccess {
|
||||||
* Unwraps `InvocationTargetException` if its getTargetException is an `Exception`.
|
* Unwraps `InvocationTargetException` if its getTargetException is an `Exception`.
|
||||||
* Other `Throwable`, such as `Error` is thrown.
|
* Other `Throwable`, such as `Error` is thrown.
|
||||||
*/
|
*/
|
||||||
private def withErrorHandling[T](body: ⇒ Either[Exception, T]): Either[Exception, T] = {
|
@inline
|
||||||
|
private final def withErrorHandling[T](body: ⇒ Either[Exception, T]): Either[Exception, T] = {
|
||||||
try {
|
try {
|
||||||
body
|
body
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue