hunk.code_window:     INVALID_CURL_HEADER(400, 4036, "Invalid header in cURL command: {0}.", AppsmithErrorAction.DEFAULT, null, ErrorType.ARGUMENT_ERROR),
       AUTHENTICATION_FAILURE(500, 5010, "Authentication failed with error: {0}", AppsmithErrorAction.DEFAULT, null, ErrorType.AUTHENTICATION_ERROR),
       INSTANCE_REGISTRATION_FAILURE(500, 5011, "Registration for instance failed with error: {0}", AppsmithErrorAction.LOG_EXTERNALLY, null, ErrorType.INTERNAL_ERROR),
       TOO_MANY_REQUESTS(429, 4039, "Too many requests received. Please try later.", AppsmithErrorAction.DEFAULT, "Too many requests", ErrorType.INTERNAL_ERROR),
       INVALID_JS_ACTION(400, 4040, "Something went wrong while trying to parse this action. Please check the JS object for errors.", AppsmithErrorAction.DEFAULT, null, ErrorType.BAD_REQUEST)
       ;
       private final Integer httpErrorCode;
  
hunk.labels: keep keep keep keep replace keep keep keep
hunk.after_edit:     INVALID_JS_ACTION(400, 4040, "Something went wrong while trying to parse this action. Please check the JS object for errors.", AppsmithErrorAction.DEFAULT, null, ErrorType.BAD_REQUEST),
       CLOUD_SERVICES_ERROR(500, 5012, "Received error from cloud services {0}", AppsmithErrorAction.DEFAULT, null, ErrorType.INTERNAL_ERROR),
  
hunk.file_path: app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java
hunk.type: replace
file: import React, { useState, useEffect } from "react";
  import styled, { css } from "styled-components";
  import { CommonComponentProps } from "components/ads/common";
  import { Colors } from "../../constants/Colors";
  
  /** Styles **/
  const MainContainer = styled.div`
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: ${Colors.Gallery};
    height: 32px;
    padding: 2px;
  `;
  
  const SwitchBlock = styled.div<{ active?: boolean }>`
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: ${Colors.DARK_GRAY};
    cursor: pointer;
    height: 100%;
    flex: 1;
  
    ${(props) =>
      props.active &&
      css`
        border: 1px solid ${Colors.ALTO2};
        background-color: ${Colors.WHITE};
        color: ${Colors.GREY_8};
      `}
  `;
  
  /** Styles End **/
  
  export type Switch = {
    id: string;
    text: string;
    action: () => void;
  };
  
  export type SwitcherProps = CommonComponentProps & {
    switches: Array<Switch>;
    activeSwitchClass?: string;
    activeObj?: Switch;
  };
  
  function Switcher(props: SwitcherProps) {
    const { activeObj, switches } = props;
    const [activeSlot, setActiveSlot] = useState("");
  
    useEffect(() => {
      if (activeObj) {
        switchClickHandler(activeObj, true);
      }
    }, [activeObj]);
  
    const switchClickHandler = (
      switchObj: Switch,
      preventSwitchAction = false,
    ) => {
      if (switchObj.id !== activeSlot) {
        setActiveSlot(switchObj.id);
        !preventSwitchAction && switchObj.action && switchObj.action();
      }
    };
  
    return (
      <MainContainer>
        {switches.map((v) => (
          <SwitchBlock
            active={v.id === activeSlot}
            id={`switcher--${v.id}`}
            key={v.id}
            onClick={() => switchClickHandler(v)}
          >
            {v.text}
          </SwitchBlock>
        ))}
      </MainContainer>
    );
  }
  
  export default Switcher;
  