Couldn't create asset file! (spelling is copied and Pasted)

this is my method
public static U GetDatabase(string DBPath, string DBName) where U : ScriptableObject
{
U asset = ScriptableObject.CreateInstance ();

		string path = AssetDatabase.GetAssetPath(asset);
			if (path == "") 
			{
				path = "Assets";
				if(!AssetDatabase.IsValidFolder(@"Assets/" + DBPath)){
					AssetDatabase.CreateFolder(@"Assets", DBPath);
				} 
			}
			else if (Path.GetExtension (path) != "") 
			{
			path = path.Replace (Path.GetFileName (AssetDatabase.GetAssetPath (Selection.activeObject)), "");

			}
			
			//string DBFullPath = @"/Assets/" + DBPath + "/" + DBName;
			string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath (@"Asset/" + DBPath + "/" + DBName);
			
			AssetDatabase.CreateAsset (asset, assetPathAndName);
			
			AssetDatabase.SaveAssets ();
			AssetDatabase.Refresh();
			return asset;

		}	

and i call it like this

public partial class ISQualityDatabaseEditor : EditorWindow {
ISQualityDatabase QualityDatabase;

void OnEnable(){
if(QualityDatabase == null)
QualityDatabase = ISQualityDatabase.GetDatabase(DATABASE_PATH, DATABASE_NAME);

	}
   }

what is going on with it?

the errors are as fallow

1.) Couldn’t create asset file!
UnityEditor.AssetDatabase:CreateAsset(Object, String)
Light.ISDatabaseGeneric`1:GetDatabase(String, String) (at Assets/Light of ItemManager/Item system/Scripts/ISDatabaseGenaric.cs:68)
Light.ItemSystem.Editor.ISObjectEditor:OnEnable() (at Assets/Light of ItemManager/Item system/Editor/Object Editor Folder/ISObjectEditor.cs:31)
UnityEditor.EditorWindow:GetWindow()
Light.ItemSystem.Editor.ISObjectEditor:init() (at Assets/Light of ItemManager/Item system/Editor/Object Editor Folder/ISObjectEditor.cs:23)

2.) UnityException: Creating asset at path failed.
Light.ISDatabaseGeneric`1[Light.ItemSystem.ISWeapon].GetDatabase[ISWeaponDatabase] (System.String DBPath, System.String DBName) (at Assets/Light of ItemManager/Item system/Scripts/ISDatabaseGenaric.cs:68)
Light.ItemSystem.Editor.ISObjectEditor.OnEnable () (at Assets/Light of ItemManager/Item system/Editor/Object Editor Folder/ISObjectEditor.cs:31)
UnityEditor.EditorWindow:GetWindow()
Light.ItemSystem.Editor.ISObjectEditor:init() (at Assets/Light of ItemManager/Item system/Editor/Object Editor Folder/ISObjectEditor.cs:23)

3.) InvalidOperationException: Operation is not valid due to the current state of the object
System.Collections.Stack.Peek () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections/Stack.cs:321)
UnityEngine.GUILayoutUtility.EndLayoutGroup () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GUILayoutUtility.gen.cs:223)
UnityEditor.DockArea.EndOffsetArea () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:769)
UnityEditor.DockArea.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:693)

4.) InvalidOperationException: Operation is not valid due to the current state of the object
System.Collections.Stack.Peek () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections/Stack.cs:321)
UnityEngine.GUILayoutUtility.EndLayoutGroup () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GUILayoutUtility.gen.cs:223)
UnityEngine.GUILayout.EndHorizontal () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GUILayout.gen.cs:244)
Light.ItemSystem.Editor.ISObjectEditor.OnGUI () (at Assets/Light of ItemManager/Item system/Editor/Object Editor Folder/ISObjectEditor.cs:41)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

plz help

YOU MUST MAKE SURE PATH IS “Assets/xxxxx/xxxxx” not like “E:/asdf/asdfasdf/Assets/asfaf” of use
application .datapath +“/aslfkasf”

The error is because the path has changed when you call Path.XXX();
You can only create asset using folder ROOT at “Assets/”.

this does not help me but anyways can someone help me because unity let me edit bloom but is something to do with the erore