Skip to content
Snippets Groups Projects
Commit 6fe716b6 authored by lumb19's avatar lumb19
Browse files

Issue #1: Create ErrorHandler

parent 4500d01d
Branches issue/1-user-class
No related tags found
No related merge requests found
import {UserInterface} from "./User"
export class ErrorHandler {
public static userHandler (input: any) {
if (typeof input.name !== "string")
throw new Error("Invalid user name");
if (typeof input.email !== "string")
throw new Error("Invalid user email");
const newUser: UserInterface = {
userName = input.name,
userEmail = input.email
}
return newUser;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment