x80486
class Response(val message: String, val path: String) { val timestamp: Long = Instant.now().toEpochMilli() var status: Int = 0 lateinit var error: String companion object { fun clientError(message: String, path: String): Response { return Response(message, path).apply { status = 400; error = "Bad Request" } } fun serverError(message: String, path: String): Response { return Response(message, path).apply { status = 500; error = "Internal Server Error" } } } }
Shawn
status
error
sealed class
Result<T>
A modern programming language that makes developers happier.