Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup storehaus-mongodb #324

Merged
merged 1 commit into from
Aug 26, 2016
Merged

Cleanup storehaus-mongodb #324

merged 1 commit into from
Aug 26, 2016

Conversation

BenFradet
Copy link
Contributor

No description provided.

@BenFradet
Copy link
Contributor Author

ping @johnynek in case you missed it

}
case None =>
if (valueObject.get(valueName).isEmpty) None
else throw new ClassCastException("Cannot convert %s to %s"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use s"Cannot convert ${value.getClass} to ${manifest[V]}"

@johnynek
Copy link
Collaborator

one minor comment (about string formatting).

I would say that maybe this code needs to be reworked. It might make sense to move it to reactivemongo http://reactivemongo.org/ which is already async and handles most of the issues here (but that is out of scope for the current PR).

@BenFradet
Copy link
Contributor Author

Agreed, will tackle string formatting here and create an issue to move to reactive mongo.

}
}
}

protected def getValue(valueObject: MongoDBObject): Option[V] = {
protected def getValue(valueObject: MongoDBObject): Try[V] =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want Try[Option[V]] here actually. Some things are legitimately None.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's what I wanted your input on earlier.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I overlooked that before.
On Wed, Aug 24, 2016 at 19:51 Ben Fradet [email protected] wrote:

In
storehaus-mongodb/src/main/scala/com/twitter/storehaus/mongodb/MongoStore.scala
#324 (comment):

   }
 }

}

  • protected def getValue(valueObject: MongoDBObject): Option[V] = {
  • protected def getValue(valueObject: MongoDBObject): Try[V] =

Yeah, that's what I wanted your input on earlier.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/twitter/storehaus/pull/324/files/ec02fb3c5fc5b7878aa97b80d3f6873fedd2e263#r76183627,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEJdhQgTrOLaYVQoWj6ngIrSaNk8Ee8ks5qjS1TgaJpZM4Jefzw
.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem.

@BenFradet
Copy link
Contributor Author

Thanks a lot for your review, sorry if I wasn't clear enough earlier.

@johnynek
Copy link
Collaborator

👍

@johnynek johnynek merged commit 3a76dc0 into twitter:develop Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants