Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
refactor(desktop): add message in exception
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaBrighi committed May 19, 2023
1 parent 2af3663 commit ea48eb4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ import com.intelligentbackpack.desktopdomain.entities.SchoolSupply
*
* @param schoolSupply The school supply that is already in the backpack.
*/
class AlreadyInBackpackException(val schoolSupply: SchoolSupply) : IllegalArgumentException()
class AlreadyInBackpackException(val schoolSupply: SchoolSupply) :
IllegalArgumentException("The school supply ${schoolSupply.rfidCode} is already in the backpack.")
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.intelligentbackpack.desktopdomain.exception

class BackpackAlreadyAssociatedException : IllegalStateException()
class BackpackAlreadyAssociatedException : IllegalStateException("A backpack is already associated.")
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package com.intelligentbackpack.desktopdomain.exception
/**
* Exception that is thrown when a RFID code is already present.
*/
class DuplicateRFIDException : IllegalArgumentException()
class DuplicateRFIDException : IllegalArgumentException("The RFID code is already present.")
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package com.intelligentbackpack.desktopdomain.exception
/**
* Exception that is thrown when a ISBN code is not valid.
*/
class ISBNException : IllegalArgumentException()
class ISBNException : IllegalArgumentException("The ISBN code is not valid.")
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package com.intelligentbackpack.desktopdomain.exception
/**
* Exception that is thrown when a RFID code is not valid.
*/
class RFIDFormatException : IllegalArgumentException()
class RFIDFormatException : IllegalArgumentException("The RFID code is not valid.")
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ package com.intelligentbackpack.desktopdomain.exception
*
* @param rfid The RFID code of the school supply that is not found.
*/
class SchoolSupplyNotFoundException(val rfid: String) : IllegalArgumentException()
class SchoolSupplyNotFoundException(val rfid: String) : IllegalArgumentException(
"The school supply with RFID code $rfid is not found.",
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import com.intelligentbackpack.desktopdomain.entities.SchoolSupplyType
* Exception that is thrown when a school supply type isn't present in the desktop.
* @param type The type that is already present.
*/
class TypeException(val type: SchoolSupplyType) : IllegalArgumentException()
class TypeException(val type: SchoolSupplyType) :
IllegalArgumentException("The type $type isn't present in the desktop.")

0 comments on commit ea48eb4

Please sign in to comment.