package com.github.dhavalmehta1997.savetogoogledrive.exception;

import org.springframework.http.HttpStatus;

public class HttpResponseException extends RuntimeException {
    HttpStatus status;

    public HttpResponseException(int statusCode) {
        this.status = HttpStatus.valueOf(statusCode);
    }

    public HttpResponseException(int statusCode, String message) {
        super(message);
        this.status = HttpStatus.valueOf(statusCode);
    }

    public HttpResponseException(int statusCode, String message, Throwable cause) {
        super(message, cause);
        this.status = HttpStatus.valueOf(statusCode);
    }

    public HttpResponseException(int statusCode, Throwable cause) {
        super(cause);
        this.status = HttpStatus.valueOf(statusCode);
    }

    public HttpResponseException(int statusCode, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.status = HttpStatus.valueOf(statusCode);
    }

    @Override
    public String toString() {
        return "HttpResponseException{" +
                "status=" + status +
                '}';
    }
}

@@ -169,16 +169,24 @@
 n %7B%0A    
+private 
 HttpStat
@@ -230,30 +230,33 @@
 ception(
-int
+HttpStatus
  status
-Code
 ) %7B%0A    
@@ -267,47 +267,27 @@
 this
-.
+(
 status
- = HttpStatus.valueOf(statusCode
+, null, null
 );%0A 
@@ -321,38 +321,41 @@
 seException(
-int
+HttpStatus
  status
-Code
 , String mes
@@ -366,32 +366,8 @@
 ) %7B%0A
-        super(message);%0A
     
@@ -378,47 +378,30 @@
 this
-.
+(
 status
- = HttpStatus.valueOf(statusCode
+, message, null
 );%0A 
@@ -435,38 +435,41 @@
 seException(
-int
+HttpStatus
  status
-Code
 , String mes
@@ -550,38 +550,14 @@
 s = 
-HttpStatus.valueOf(
 status
-Code)
 ;%0A  
@@ -594,30 +594,33 @@
 ception(
-int
+HttpStatus
  status
-Code
 , Throwa
@@ -636,30 +636,8 @@
 ) %7B%0A
-        super(cause);%0A
     
@@ -648,46 +648,27 @@
 this
-.
+(
 status
- = HttpStatus.valueOf(statusCod
+, null, caus
 e);%0A
@@ -711,22 +711,25 @@
 ion(
-int
+HttpStatus
  status
-Code
 , St
@@ -912,38 +912,14 @@
 s = 
-HttpStatus.valueOf(
 status
-Code)
 ;%0A  

optimize logic