Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ballerina/io;
- const INVALID_ACC_ID = "InvalidAccountId";
- const INVALID_ACC_ID_CODE = 1234;
- function updateAccount(int accountId, decimal amount) {
- if (accountId < 1000) {
- panic error(INVALID_ACC_ID, code = INVALID_ACC_ID_CODE);
- }
- // Account update logic.
- io:println("Updated Account for ID ", accountId, " , Amount: ", amount);
- }
- public function main() {
- updateAccount(2500, 1500.00);
- updateAccount(25, 1000.00);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement