+ # Raised when the changeset provided is not yet closed
+ class APIChangesetNotYetClosedError < APIError
+ def initialize(changeset)
+ @changeset = changeset
+ end
+
+ attr_reader :changeset
+
+ def status
+ :conflict
+ end
+
+ def to_s
+ "The changeset #{@changeset.id} is not yet closed."
+ end
+ end
+
+ # Raised when a user is already subscribed to the changeset
+ class APIChangesetAlreadySubscribedError < APIError
+ def initialize(changeset)
+ @changeset = changeset
+ end
+
+ attr_reader :changeset
+
+ def status
+ :conflict
+ end
+
+ def to_s
+ "You are already subscribed to changeset #{@changeset.id}."
+ end
+ end
+
+ # Raised when a user is not subscribed to the changeset
+ class APIChangesetNotSubscribedError < APIError
+ def initialize(changeset)
+ @changeset = changeset
+ end
+
+ attr_reader :changeset
+
+ def status
+ :not_found
+ end
+
+ def to_s
+ "You are not subscribed to changeset #{@changeset.id}."
+ end
+ end
+