forked from Hexlet/hexlet-correction
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Hexlet#276]. update js script, update tests, add override handleMeth…
…odArgumentNotValid method
- Loading branch information
Showing
4 changed files
with
89 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/io/hexlet/typoreporter/handler/domain/ApiError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.hexlet.typoreporter.handler.domain; | ||
|
||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@Getter | ||
public class ApiError { | ||
|
||
private final HttpStatus status; | ||
private final String message; | ||
private final List<String> errors; | ||
|
||
public ApiError(HttpStatus status, String message, List<String> errors) { | ||
super(); | ||
this.status = status; | ||
this.message = message; | ||
this.errors = errors; | ||
} | ||
|
||
public ApiError(HttpStatus status, String message, String error) { | ||
super(); | ||
this.status = status; | ||
this.message = message; | ||
errors = Collections.singletonList(error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters