aznhassan / speedster

A auto-styling note taking application
1 stars 1 forks source link

Flashcard file breaks on certain POST requests, giving 500 errors. #16

Closed TheTeraByte closed 9 years ago

TheTeraByte commented 9 years ago

Here's the stack trace:

org.json.JSONException: JSONObject["noteId"] not found. at org.json.JSONObject.get(JSONObject.java:476) at org.json.JSONObject.getString(JSONObject.java:657) at edu.brown.cs.mmth.speedster.Flashcard.updateFields(Flashcard.java:146) at edu.brown.cs.mmth.fileIo.FlashCardReader.readCardsInFolder(FlashCardReader.java:108) at edu.brown.cs.mmth.fileIo.FlashCardReader.getCardsLinkedWithNote(FlashCardReader.java:68) at edu.brown.cs.mmth.speedster.ApiHandler$UpdateNotes.handle(ApiHandler.java:345) at spark.SparkBase$1.handle(SparkBase.java:174) at spark.webserver.MatcherFilter.doFilter(MatcherFilter.java:144) at spark.webserver.JettyHandler.doHandle(JettyHandler.java:54) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:179) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

TheTeraByte commented 9 years ago

@aznhassan Can our Flashcard reader handle being given a note ID that does not have any associated flashcards? Also we seem to be mixing up flashcard ID and note ID somewhere (the file structure is quite corrupted right now.... :-/ )

TheTeraByte commented 9 years ago

Seems to be coming from the 22 folder which has a note without a noteID. Might have been written using old code (also our programming shouldn't be breaking so much....large scale exception handling?) and since is now being read using modern code that error would make sense.

TheTeraByte commented 9 years ago

Closed this as haven't seen it happen again. #janky