Skip to content

Commit a7155b6

Browse files
committed
Declare throws Exception in the interfaces for background functions. This saves users from having to catch checked exceptions and rethrow them as unchecked ones.
Fixes #21. PiperOrigin-RevId: 304515456
1 parent fb4bae2 commit a7155b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

functions-framework-api/src/main/java/com/google/cloud/functions/BackgroundFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ public interface BackgroundFunction<T> {
5555
* @param context the context of the event. This is a set of values that every event has,
5656
* separately from the payload, such as timestamp and event type.
5757
*/
58-
void accept(T payload, Context context);
58+
void accept(T payload, Context context) throws Exception;
5959
}

functions-framework-api/src/main/java/com/google/cloud/functions/RawBackgroundFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ public interface RawBackgroundFunction {
7070
* @param context the context of the event. This is a set of values that every event has,
7171
* separately from the payload, such as timestamp and event type.
7272
*/
73-
void accept(String json, Context context);
73+
void accept(String json, Context context) throws Exception;
7474
}

0 commit comments

Comments
 (0)