Skip to content

Commit 5ac1430

Browse files
committed
Remove the NotFoundException.
1 parent ab82c98 commit 5ac1430

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

force-app/main/default/classes/libak_ErrorResponseFactory.cls

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
public class libak_ErrorResponseFactory implements libak_RestFramework.IErrorResponseFactory {
66
private Map<String, Integer> httpStatusByErrorType = new Map<String, Integer>{
77
libak_RestFramework.InvalidUriException.class.getName() => libak_RestFramework.HTTP_CODE_BAD_REQUEST,
8-
libak_RestFramework.NotFoundException.class.getName() => libak_RestFramework.HTTP_CODE_NOT_FOUND,
98
libak_RestFramework.MethodNotAllowedException.class.getName() => libak_RestFramework.HTTP_CODE_METHOD_NOT_ALLOWED
109
};
1110

force-app/main/default/classes/libak_RestFramework.cls

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ public class libak_RestFramework {
9898
*/
9999
public class InvalidUriException extends Exception {}
100100

101-
/**
102-
* This exception is thrown when a requested resource is not found. It represents a client error (HTTP 404 Not Found).
103-
*/
104-
public class NotFoundException extends Exception {}
105-
106101
/**
107102
* This exception is thrown when an HTTP method is not allowed for a particular resource. It represents a client error (HTTP 405 Method Not Allowed).
108103
*/

force-app/main/default/classes/tests/libak_TestErrorResponse.cls

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ public with sharing class libak_TestErrorResponse {
55
static void testErrorResponseInstance(){
66
RestContext.response = new RestResponse();
77
libak_RestFramework.IRestResponse response = new libak_ErrorResponse(
8-
libak_RestFramework.HTTP_CODE_NOT_FOUND,
9-
new libak_RestFramework.NotFoundException('Not found')
8+
libak_RestFramework.HTTP_CODE_BAD_REQUEST,
9+
new libak_RestFramework.InvalidUriException('Bad Request')
1010
);
1111

1212
Test.startTest();
@@ -25,9 +25,9 @@ public with sharing class libak_TestErrorResponse {
2525
'The "Content-Type" header should be "application/json"'
2626
);
2727
System.assertEquals(
28-
libak_RestFramework.HTTP_CODE_NOT_FOUND,
28+
libak_RestFramework.HTTP_CODE_BAD_REQUEST,
2929
RestContext.response.statusCode,
30-
'The status code of response should be 200'
30+
'The status code of response should be ' + libak_RestFramework.HTTP_CODE_BAD_REQUEST
3131
);
3232
System.assertEquals(
3333
Blob.valueOf(JSON.serialize(response)),

0 commit comments

Comments
 (0)