Skip to main content

System Message

HTTP Exceptions 🚨​

Exception TypeStatus CodeTypeMessage
CustomHTTPException400default_typeDefaultMessage
InvalidCredentialsException401invalid_credentialsInvalid credentials
UserNotFoundException404user_not_foundUser not found
UserAlreadyExistsException400user_already_existsUser already exists
InvalidRefreshTokenException404invalid_refresh_tokenInvalid refresh token
NotAuthorisedException403not_authorisedNot authorised
LocationNotFoundException404no_locationNot found any location in the given area
InvalidSearchQueryException400invalid_search_queryInvalid search query
RouteNotFoundException404no_routeNot found any route in the given area
ParametersTooLargeException400parameters_too_largeParameters too large
AlreadyVotedException409already_votedAlready voted
VoteNotFoundException404vote_not_foundVote not found
RequestValidationError400missingField required
RequestValidationError400string_pattern_mismatchString should match pattern
RequestValidationError400json_invalidJSON decode error
RequestValidationError400string_typeInput should be a valid string
RequestValidationError400string_too_shortString should have at least {} characters
RequestValidationError400string_too_longString should have at most {} characters
RequestValidationError400value_errorLocation type must be one of 'landmark', 'restaurant', 'grocery', or 'pharmacy'.
RequestValidationError400value_errorRoute type must be one of 'driving', 'walking', or 'cycling'.

SocketIO messages 📨​

EventMessage TypeDetails TypeDetails Msg
connecterrorinvalid_credentials'Invalid credentials'
N/AVaries with HTTPExceptionDepends on the error detail from exception
join_roomerrorno_room'Room not found or has expired'
roomjoined_roomE.g. "admin has joined room 448408"
leave_roomroomlefted_roomE.g. "admin has left room 448408"
movemovesuccessObject with lat and long, e.g. {lat: 34, long: 34}
errorinvalid_data'Invalid data'
disconnectroomdisconnectedE.g. "admin disconnected"

To get message in the frontend:

  • const messageType = message.type;
  • const detailsType = message.message.details.type;
  • const detailsMsg = message.message.details.msg;