Skip to content

Commit df11534

Browse files
chore: wip
1 parent 5f4e04a commit df11534

File tree

1 file changed

+7
-5
lines changed
  • storage/framework/core/email/src

1 file changed

+7
-5
lines changed

storage/framework/core/email/src/email.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,27 @@ export class Email {
5757
}
5858
}
5959

60-
public async onError(error: Error) {
60+
public async onError(error: Error): Promise<{ message: string }> {
6161
log.error(error)
6262

6363
if (!this.message.onError)
64-
return
64+
return { message: 'error!' }
6565

6666
return await this.message.onError(error)
6767
}
6868

69-
public onSuccess() {
69+
public async onSuccess(): Promise<{ message: string }> {
7070
try {
7171
if (!this.message.onSuccess)
72-
return
72+
return { message: 'Error!' }
7373

7474
this.message.onSuccess()
7575
}
7676
catch (error) {
77-
return this.onError(error as Error)
77+
return await this.onError(error as Error)
7878
}
79+
80+
return { message: 'Success!' }
7981
}
8082
}
8183

0 commit comments

Comments
 (0)